• nivyaj
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 9
    Replies

SETUP:

I have a page <apex:pageBlockSection> where I'm putting in a lot of fields. The output labels are being rendered on several lines  Here, social security # is going onto 3 lines

    <apex:pageBlockSectionItem helpText="hepMe">
        <apex:outputLabel value="Social Security Number" />
        <apex:outputField value="{!obj.Social_Security_Number__c}" />
    </apex:pageBlockSectionItem>
                   

 



To get around this, I changed the implementation to pageblocksections


     <apex:pageBlocksection columns="1">
          <apex:pageBlockSectionItem helpText="help" dataStyle="text-align:left; width: 30%; max-width: 30%;">
               <apex:outputLabel value="Social Security Number" />
               <apex:outputField value="{!Obj.Social_Security_Number__c}" />
          </apex:pageBlockSectionItem>
    </apex:pageblockSection>

 



PROBLEM:

The CSS `dataStyle="text-align:left; width: 30%; max-width: 30%;"` is not being uniformly applied across browsers. it looks great in IE, but in FF the field columns are not lining up properly.

How do I fix this?

  • January 17, 2013
  • Like
  • 0

I have a VF page with a lot of fields. the requirement is that all the error messages on the fields need to be listed together at the top of the page and have field level error messages. Currently, we have something like this:

 

<apex:inputField value = 'f1' required = true/>
<apex:inputField value = 'f2' required = true/>

 

 

 

When the user clicks submit, and if the values for f1 and f2 are blank, the first field is displayed in the errormessage, and at the field level, there is an error on both saying ERROR- you must enter in a value (at the field level, we want this).

Basically, the requirement is

  1. for the required fields have a red bar
  2. if the fields are not filled in, display field level errors
  3. For all the field level errors, display a message at the top of the page saying the user needs to enter in these values
  • December 27, 2012
  • Like
  • 0

I'm new to web development, but I'm running into a bug. Below is more or less my code. when I use the attribute: dataStyle="text-align:left; width: 30%; max-width: 30%;" it's not being consistently rendrered in IE and firefox. it works in IE but in FF the labels and input fields are not lining up. HALP!

 

 

<apex:pageblockSection>

     <apex:pageblockSection columns ="1">
        <apex:pageblockSectionitem dataStyle="text-align:left; width: 30%; max-width: 30%;"
            <apex:outputLabel value="Field 1" />
            <apex:inputField value="{!field_1}"
        </apex:pageblockSectionitem>
      </apex:pageblockSection>

     <apex:pageblockSection columns ="1">
        <apex:pageblockSectionitem dataStyle="text-align:left; width: 30%; max-width: 30%;"
            <apex:outputLabel value="Field 2" />
            <apex:inputField value="{!field_2}"
        </apex:pageblockSectionitem>
      </apex:pageblockSection>

</apex:pageblockSection>

 

  • December 24, 2012
  • Like
  • 0

I have a business request, saying they want one of the custom tabs (X)  to be the last one on the banner. I know that you can define the ordering of the tabs by:

 

Setup -> App Setup - > Create -> Apps

 

is there a way to say for all users of a profile (or set of profiles) make this the last tab?  

 

Thanks!

 

 

 

 

  • December 03, 2012
  • Like
  • 0

we're trying to do some basic analysis of personal reports for our org- like the distribution of reports made from one profile vs all the others, or even an org wide count. Really anything....

 

 

Is there anyway to get some analytics when it comes to personal reports?

  • October 16, 2012
  • Like
  • 0

When the end user creates a view on contacts, they don't want some of the automatic fields displayed in the selected fields section. They want the title and contact owner alias selection removed from the default for all new views they created going forward.

 

How do I over-ride that setting?

 

the default fields are:

 

Name

Account Name

Title

Phone

Email

Contact Owner Alias.

  • October 12, 2012
  • Like
  • 0

Here is the set up. I have a standard page layout with custom buttons.

 

When the user clicks a button, i want to check a value in the extension class. If the value is null or 0- i want a pages message to appear on the current page (or get a pop-up), otherwise i want to redirect them to another VF page.

the way that i'm attempting to do this is put a VF section on the page layout, and have it conditionally render the message using an action:support method, but I can't get it to work..

 

Help?

  • August 07, 2012
  • Like
  • 0

Setup:

When a user does email-to-case the created by field is an automated case user.

 

 

Questions:

  1. How do I detect if it was by outlook?
  2. I need to get the orignal sender. I am trying to get the header of the email but I cannot get it for Outlook... Any ideas on how to get the original sender's email or how to get the header?

 

Thanks

Setup:

 

We have some cases that are created using the email-to-case feature using outlook. When those cases come in, they get assigned to a user or a queue. I want to re-assign the ownerId to the person who created it.

 

Questions:
1. How do I ID if the case was from this feature?

2.  Is this as straight forward as this:

 

 

trigger CaseTrigger on Case (before insert, before update) {

 

for (Case c: trigger.new){

      //if (outlook.Indicator == true){

     

      c.OwnerId = c.CreatedById;

}

 

I'm looking into using apex scheduler to run a batch job. We can run it whenever we want, say 3 am when traffic is low, but I'm trying to anticipate some 'Oh-Crap' Scenerios. Can you guys help answer these questions for me?

 

Setup:

When the user modifies a territory 100k's of records can get updated.

 

 

Questions:

  1. What are some scenerios that can realistically cause my jobs to not terminate? I thought of a scenerio of- when a user is editing a contact which happens to be in one of the batches is being run.

  2. What are some good practices for dealing with jobs that don't terminate? I was thinking about scheduling another batch job 2 hours after this one, but I don't see my boss liking that. I thought about maybe doing something in the finish() method- but don't know what exactly.

Thanks,

I need help with a design issue and what happens in Batch Apex.

 

Setup

This is the scenario we have: We have a territory object, then when you update a single field needs to update a field on UPTO hundreds of thoursands of contacts. To do this, I am using Batch Apex. And invoking it on the territory record before it’s updated.

 

 

Question:

  1. Say the user updates the territory from A to B, and clicks save. This causes a big batch of contacts to get updated and take a while Then, he changes B to C. Are we guaranteed that the final update on all impacted records will be C? How come?

  2. Or, is there a way to schedule your batch jobs? I’m looking into asyncApexJob and using that as a framework…

  3. Is there a better design?

Setup:

 

A--< B >-- C . On A there is a RFS on B, and then there is an after update trigger that when run populates fields on B. One of B's Fields are then rolled-up into a field on C.

 

 

Question:

The trigger works, but i need to run it on the existing records in the DB to bring everything up to date. How do I do that? I already tried running a 'force mass recalculation with the RFS on A and C.

SETUP and GOAL

 

I have a controlling field TYPE with a dependant field SUBTYPE. I want to add two options in the dependent field that is only visable to 1 record type (or a defined set of profiles).

 

 

Confusion

 

My boss, said we can do this- since we're making additions to only 1 controlling field column. I thought this was not possible because if you make these additions availible to a controlling field option (via the field dependency matrix), then anyone who can see that controlling field (via record type) should see the options. (the intersection thing from https://login.salesforce.com/help/doc/en/fields_dependent_field_considerations.htm )

 

 

Questions:

 

1. I don't get why this doesn't affect ALL record types that have that controlling field selected in their profiles? - so if I have profile A and B, both have access to that controlling field- Why are the dependent fields only exposed to A and not B?

 

2. how do I implement this? Thanks, -Das Noob.

  • April 30, 2012
  • Like
  • 0

Two of my sandboxes upgraded today to Spring 13, and I can't Deploy metadata to them using the Force.com IDE. I'm seeing the errors:

 

   Problem: Unknown type name 'MobileSettings' specified in package.xml
   Problem: Unknown type name 'SecuritySettings' specified in package.xml

Has anyone seen this or know of a workaround?

 

Dan

 

Setup:

 

We have some cases that are created using the email-to-case feature using outlook. When those cases come in, they get assigned to a user or a queue. I want to re-assign the ownerId to the person who created it.

 

Questions:
1. How do I ID if the case was from this feature?

2.  Is this as straight forward as this:

 

 

trigger CaseTrigger on Case (before insert, before update) {

 

for (Case c: trigger.new){

      //if (outlook.Indicator == true){

     

      c.OwnerId = c.CreatedById;

}

 

I need help with a design issue and what happens in Batch Apex.

 

Setup

This is the scenario we have: We have a territory object, then when you update a single field needs to update a field on UPTO hundreds of thoursands of contacts. To do this, I am using Batch Apex. And invoking it on the territory record before it’s updated.

 

 

Question:

  1. Say the user updates the territory from A to B, and clicks save. This causes a big batch of contacts to get updated and take a while Then, he changes B to C. Are we guaranteed that the final update on all impacted records will be C? How come?

  2. Or, is there a way to schedule your batch jobs? I’m looking into asyncApexJob and using that as a framework…

  3. Is there a better design?

Setup:

 

A--< B >-- C . On A there is a RFS on B, and then there is an after update trigger that when run populates fields on B. One of B's Fields are then rolled-up into a field on C.

 

 

Question:

The trigger works, but i need to run it on the existing records in the DB to bring everything up to date. How do I do that? I already tried running a 'force mass recalculation with the RFS on A and C.

SETUP and GOAL

 

I have a controlling field TYPE with a dependant field SUBTYPE. I want to add two options in the dependent field that is only visable to 1 record type (or a defined set of profiles).

 

 

Confusion

 

My boss, said we can do this- since we're making additions to only 1 controlling field column. I thought this was not possible because if you make these additions availible to a controlling field option (via the field dependency matrix), then anyone who can see that controlling field (via record type) should see the options. (the intersection thing from https://login.salesforce.com/help/doc/en/fields_dependent_field_considerations.htm )

 

 

Questions:

 

1. I don't get why this doesn't affect ALL record types that have that controlling field selected in their profiles? - so if I have profile A and B, both have access to that controlling field- Why are the dependent fields only exposed to A and not B?

 

2. how do I implement this? Thanks, -Das Noob.

  • April 30, 2012
  • Like
  • 0

With Spring '12 there's you can now create a case from outlook using the Salesforce for Outlook plugin.

 

This is great, but it can also be a bit frustrating. If you want each indiviual user to have a case "owned" by them after hitting that button, you need to create separate destinations for each user. This means separate configuration for each user. Bleh!

 

So I'm working on a work around. What I've come up with is a Trigger on the EmailMessage. It looks at the FromAddress, grabs the ParentID (case id) and changes the owner to the active Salesforce user with either the Username or Email of the FromAddress. If that fails, it assigns it to the case creator.

 

The gotcha's I've thought of are:

  1. It requires the User to have the Username/Email of the From Address
  2. The assumption is you have only 1 user with that FromAddress as their email or Username
  3. That you want to have it assigned to the Creator if a user isn't found

Here's what I got so far (no test class yet). I appreciate any feedback you have.

 

trigger EmailMessage_CaseCreation on EmailMessage (after insert) {
//Review incoming new cases. If OwnerId = CaseQueue.id then change Owner to CreatedById
    //Name of the queue created
    string QueueName = 'CaseQueue';
    Group CaseQueue = [Select g.Type, g.RelatedId, g.OwnerId, g.Name,g.Id, g.Email  From Group g where g.type = 'Queue' and g.name = :QueueName limit 1];
    set<id> sCaseIDs = new set<id>();
    set<string> sFromAddresses = new set<string>();
    map<id,EmailMessage> mCase2Email = new map<id,EmailMessage>();
    for(integer i=0; i<trigger.new.size(); i++){
        sCaseIds.add(Trigger.new[i].ParentId);
        mCase2Email.put(Trigger.new[i].ParentID, Trigger.new[i]);
        sFromAddresses.add(Trigger.new[i].FromAddress);
    }
    list<Case> lCases = [select id, subject, OwnerId,Createdbyid from Case where id in :sCaseIds];
    if(CaseQueue != null){
        
        if(mCase2Email.size()>0){
            map<string, user> mEmail2User = new map<string, user>();
            For(User u :[Select id, Username, Email From User where IsActive = True and (Username in:sFromAddresses or Email in: sFromAddresses)]){
                system.debug('User added to map: ' + u.email);
                mEmail2User.put(u.email.toLowerCase(), u);
                mEmail2User.put(u.Username.toLowerCase(), u);
            }
            for(integer i=0; i<lCases.size(); i++){
                if(lCases[i].OwnerID == CaseQueue.id){                
                    system.debug('Email From Address is: ' + mCase2Email.get(lCases[i].id).FromAddress);
                    User u = new user(); 
                    u = mEmail2User.get(mCase2Email.get(lCases[i].id).FromAddress.toLowerCase());
                    system.debug('User: ' + u);
                    if(mEmail2User.get(mCase2Email.get(lCases[i].id).FromAddress.toLowerCase()) != null){
                        system.debug('Found User!: ' + mEmail2User.get(mCase2Email.get(lCases[i].id).FromAddress.toLowerCase()).id);  
                        lCases[i].OwnerID = mEmail2User.get(mCase2Email.get(lCases[i].id).FromAddress.toLowerCase()).id;
                    }else{
                        system.debug('Created by: ' + lCases[i].CreatedbyId);
                        lCases[i].OwnerID = lCases[i].CreatedbyId;
                    }
                    system.debug('Owner Changed! ' + lCases[i].OwnerID);
                }
            }
            update lCases;
        }else{system.debug('NO EMAILS FOUND');}
    }
}

 

 

 

The "MIXED_DML_OPERATION" issue that plagues unit tests (see this forum discussion) is now effecting production code as well.

Our application adds an extra custom field to Users called "Other Emails".  This is a string field where a User can enter a bunch of email aliases; whenever it's updated we normalize the information into a separate "EmailAddress" table and the Address then points back at the User.

As of yesterday, that worked great.  I updated my User record to add an address to the "Other Emails" field.  The trigger code executed perfectly, and the EmailAddress object was created & linked to my User record.

As of today, it is failing:



This is a critical part of an Apex-based application that we have been developing for over 8 months, and this section of code has always worked until today.

We've had to comment out unit tests to deal with this issue - which was lame, but acceptable - but actually changing our object relationships and code at this late date would be difficult.
  • June 19, 2008
  • Like
  • 0