• Marie Kagay
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 1
    Replies
I used the Workbench REST Explorer to query the EventLogFile, and the results only returned 2 of the 28 Event Types. The Event Types returned were 'Login' and 'Logout'.
Why aren't the other Event Types being returned? I know that most of the other Event Types have been executed over the last 30 days. 

The query I used is: /services/data/v32.0/query?q=SELECT+Id+,+EventType+,+LogFile+,+LogDate+,+LogFileLength+FROM+EventLogFile

Thanks!
I have a text field on Opportunity Product that is updated via apex with the values of a multi-select picklist fields. A number of values from the multi-select picklist are all uppercase and at this time need to remain so. 
However, we'd like the all uppercase values to be updated to proper case when the apex code brings them over to the text field. (I'm defining proper case and first letter of a word is upper case, the rest are lower case). Since the values are all seperated by semi-colons when updated in the text field, I would like to have this update run on every value separated by a semi-colon.
For example, if the multiselect picklist has values "JAPAN;CANADA;PERU", my current apex code updates my text field with "JAPAN;CANADA;PERU". Is there a method I could use that would update the text field to "Japan;Canada;Peru"?

Thanks!
Does anyone have any recommendations for a great SFDC consulting firm with consultants who can come onsite in San Francisco? Specifically the firm should have consultants that can help assist with technical architecture and consultants that can help develop complex Apex and Visualforce projects.
Any suggestions greatly appreciated!
I'm attempting to set the Contact Owner based on the Account Billing Country using a Custom Setting, Lead_Assignment__c, that maps Country to a User Id. When a Contact is created or updated, the trigger pulls the mapped Country and User Id values from the Custom Setting, finds the Billing Country value from the Account associated with the Contact, and sets the Contact Owner with the User Id that correlates with the Country value that matches the Billing Country.

When I run my trigger, the bolded system.debug show that the Contact Owner values is being set correctly (i.e. the User Id is the User Id mapped to the Billing Country in the Custom Setting), but the field is ulitmately not updated with the correct User Id. Based on field history tracking, it does not look like its being updated at all.
Am I missing something on this trigger?

trigger AssignContact on Contact (before insert, before update) {    
    Set<String> accountSet = new Set<String>();
    Set<Id> contactIdSet = new Set<Id>();
    List<Lead_Assignment__c> lstBillingOwner = [Select ID,Country__c, New_Owner_ID__c FROM Lead_Assignment__c];
    Map<String,String> mpCountryOwner = new Map<String,String>();

    for(Lead_Assignment__c l1 :  lstBillingOwner)    {
        mpCountryOwner.put(l1.Country__c, l1.New_Owner_ID__c);
    }    

    Map<Id,User> mpUser = new Map<Id,User>([Select ID FROM User Where ID IN :mpCountryOwner.values()]);
    Set<Id> accIds = new Set<Id>();

    for(Contact con : trigger.new){
        accIds.add(con.AccountId);
    }

    Map<Id,Account> mpAcc = new Map<Id,Account>([Select ID, Name, BillingCountry FROM Account Where ID IN :accIds]);
    for(Contact con : trigger.new){
        Account act = mpAcc.get(con.AccountId);
        
        if(con.AccountId != null && act.BillingCountry != null){
            if(mpCountryOwner.get(act.BillingCountry) != null){
                con.owner = mpUser.get(mpCountryOwner.get(act.BillingCountry) );  
                System.debug('***** - Updating Owner - New Owner - '+con.owner);
            }
        }
    }
 }



 
Does anyone have any recommendations for a great SFDC consulting firm with consultants who can come onsite in San Francisco? Specifically the firm should have consultants that can help assist with technical architecture and consultants that can help develop complex Apex and Visualforce projects.
Any suggestions greatly appreciated!
I'm attempting to set the Contact Owner based on the Account Billing Country using a Custom Setting, Lead_Assignment__c, that maps Country to a User Id. When a Contact is created or updated, the trigger pulls the mapped Country and User Id values from the Custom Setting, finds the Billing Country value from the Account associated with the Contact, and sets the Contact Owner with the User Id that correlates with the Country value that matches the Billing Country.

When I run my trigger, the bolded system.debug show that the Contact Owner values is being set correctly (i.e. the User Id is the User Id mapped to the Billing Country in the Custom Setting), but the field is ulitmately not updated with the correct User Id. Based on field history tracking, it does not look like its being updated at all.
Am I missing something on this trigger?

trigger AssignContact on Contact (before insert, before update) {    
    Set<String> accountSet = new Set<String>();
    Set<Id> contactIdSet = new Set<Id>();
    List<Lead_Assignment__c> lstBillingOwner = [Select ID,Country__c, New_Owner_ID__c FROM Lead_Assignment__c];
    Map<String,String> mpCountryOwner = new Map<String,String>();

    for(Lead_Assignment__c l1 :  lstBillingOwner)    {
        mpCountryOwner.put(l1.Country__c, l1.New_Owner_ID__c);
    }    

    Map<Id,User> mpUser = new Map<Id,User>([Select ID FROM User Where ID IN :mpCountryOwner.values()]);
    Set<Id> accIds = new Set<Id>();

    for(Contact con : trigger.new){
        accIds.add(con.AccountId);
    }

    Map<Id,Account> mpAcc = new Map<Id,Account>([Select ID, Name, BillingCountry FROM Account Where ID IN :accIds]);
    for(Contact con : trigger.new){
        Account act = mpAcc.get(con.AccountId);
        
        if(con.AccountId != null && act.BillingCountry != null){
            if(mpCountryOwner.get(act.BillingCountry) != null){
                con.owner = mpUser.get(mpCountryOwner.get(act.BillingCountry) );  
                System.debug('***** - Updating Owner - New Owner - '+con.owner);
            }
        }
    }
 }