• Harold Crouse
  • NEWBIE
  • -1 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
So I'm trying to run a script that takes converted leads and copies their created date onto a field on the created account and I'm finding some strange things.  Well things I thought weren't strange until I started investigating more.  Script is simple
 
map<id,DateTime> accountsWithDate = new map<id,DateTime>();
For(Lead l: [Select ConvertedAccountID, CreatedDate from Lead where IsConverted = true]){
      AccountsWithDate.put(l.ConvertedAccountID,l.CreatedDate);
}
list<Account> accounts = new list<Account>();
for(Account a [Select id, Lead_Creation_DAte__c from Account where Id in: accountsWithDate.get(a.id)){
      a.Lead_Creation_Date__c = accountsWithDAte.get(a.id);
      accounts.add(a);
}
update accounts;

So as expected I'm finding multiple leads that contain the same ConvertedAccountID, I assume from converting a duplicate lead and chooseing merge into existing account.  However when I run the leads with converted information report and include Account ID as converted Account ID is not available on the report;  I see two different Accounts?

Results from the report:
 User-added image
Results from the query
User-added image

I'm not sure what is happening here?  Anyone have any insights?
So I'm trying to move a customer portal over to a community.  I have one visualforce page that generates a error "Error: Error Occured while loading a Visualforce page"

When I turn on the debug logs there's not much information in there but this code:

17.0 APEX_CODE,FINEST;APEX_PROFILING,FINEST;CALLOUT,FINEST;DB,FINEST;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,FINER;WORKFLOW,FINER
21:39:36.115 (115519618)|EXECUTION_STARTED
21:39:36.115 (115554881)|CODE_UNIT_STARTED|[EXTERNAL]|06640000000TNPF|VF: /apex/Exception
21:39:36.119 (119492891)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.119 (119575647)|VF_EVALUATE_FORMULA_END
21:39:36.119 (119590598)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.119 (119615591)|VF_EVALUATE_FORMULA_END
21:39:36.120 (120803221)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/img/sites/force_logo.png
21:39:36.120 (120848355)|VF_EVALUATE_FORMULA_END
21:39:36.120 (120935584)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.120 (120965057)|VF_EVALUATE_FORMULA_END
21:39:36.120 (120974637)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.120 (120990629)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121001242)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121017687)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121025388)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121039876)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121056110)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/secur/logout.jsp
21:39:36.121 (121083416)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121107628)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121130764)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121200072)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121224299)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121233994)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121248919)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121305749)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121328132)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121339221)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121358486)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121580720)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{URLFOR($Resource.SiteSamples, 'img/clock.png')}
21:39:36.121 (121635760)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121684499)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{URLFOR($Resource.SiteSamples, 'img/warning.gif')}
21:39:36.121 (121729667)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121943270)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF| #{$Label.site.get_in_touch}
21:39:36.121 (121990677)|VF_EVALUATE_FORMULA_END
21:39:36.122 (122021392)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|mailto:#{$Site.AdminEmailAddress}
21:39:36.129 (129846299)|VF_EVALUATE_FORMULA_END
21:39:36.129 (129915080)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|mailto:#{$Site.AdminEmailAddress}
21:39:36.136 (136469626)|VF_EVALUATE_FORMULA_END
21:39:36.136 (136797945)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{URLFOR($Resource.SiteSamples, 'img/poweredby.png')}
21:39:36.136 (136857156)|VF_EVALUATE_FORMULA_END
21:39:36.137 (137316766)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/img/sites/poweredby.png
21:39:36.137 (137353875)|VF_EVALUATE_FORMULA_END
21:39:36.138 (138695047)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/site/SiteStyles.css
21:39:36.138 (138733274)|VF_EVALUATE_FORMULA_END
21:39:36.138 (138777708)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.138 (138805219)|VF_EVALUATE_FORMULA_END
21:39:36.138 (138822387)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.138 (138841045)|VF_EVALUATE_FORMULA_END
21:39:36.139 (139151847)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/site/SiteStyles.css
21:39:36.139 (139182654)|VF_EVALUATE_FORMULA_END
21:39:36.139 (139221824)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.139 (139247962)|VF_EVALUATE_FORMULA_END
21:39:36.139 (139258523)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.139 (139274861)|VF_EVALUATE_FORMULA_END
21:39:36.242 (141915300)|CUMULATIVE_LIMIT_USAGE
21:39:36.242|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 10
  Number of Mobile Apex push calls: 0 out of 10

21:39:36.242|TOTAL_EMAIL_RECIPIENTS_QUEUED|0
21:39:36.242|CUMULATIVE_LIMIT_USAGE_END

21:39:36.246|CUMULATIVE_PROFILING_BEGIN
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for SOQL operations
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for SOSL operations
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for DML operations
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for method invocations
21:39:36.246|CUMULATIVE_PROFILING_END
21:39:36.141 (141957077)|CODE_UNIT_FINISHED|VF: /apex/Exception
21:39:36.144 (144030919)|EXECUTION_FINISHED

I'm lost.  
Hi Everyone

I have a simple before update trigger below. I am trying to catch any error and log to a custom table. The below will cause Duplicate error in UI but nothing is inserted into custome object USD_Error_Log__c.. Its like trigger does not fall into either DMLException or Exception catch blocks. Any and all help is appreciated.

Thanks

Jon

trigger USD_Contact on Contact(before update){

Set<USD_Error_Log__c> student = new Set<USD_Error_Log__c>(); 

for (Contact c: Trigger.new) {
    // delete [select id from USD_Error_Log__c];    
    
try{
  
     c.TargetX_SRMb__BannerID__c = '008372883';   // this will cause Duplicate value on record error      
     
} catch (DMLException e) {

  string error = e.getMessage();
  student.add(new USD_Error_Log__c(Banner_ID__c = c.TargetX_SRMb__BannerID__c,Error_Message__c = error ));
  
  if(!student.isEmpty()){   
   List<USD_Error_Log__c> toInsert = new List<USD_Error_Log__c>();
   try{
      toInsert.addAll(student);
      insert toInsert;     
   }catch(Exception se){
   }                             
  } 

} catch(Exception e) {
    
  string error = e.getMessage();
  student.add(new USD_Error_Log__c(Banner_ID__c = c.TargetX_SRMb__BannerID__c,Error_Message__c = error ));
  
  if(!student.isEmpty()){   
   List<USD_Error_Log__c> toInsert = new List<USD_Error_Log__c>();
   try{
      toInsert.addAll(student);
      insert toInsert;     
   }catch(Exception se){
   }                             
  } 
  
    
}

}//end loop



}
So I'm trying to move a customer portal over to a community.  I have one visualforce page that generates a error "Error: Error Occured while loading a Visualforce page"

When I turn on the debug logs there's not much information in there but this code:

17.0 APEX_CODE,FINEST;APEX_PROFILING,FINEST;CALLOUT,FINEST;DB,FINEST;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,FINER;WORKFLOW,FINER
21:39:36.115 (115519618)|EXECUTION_STARTED
21:39:36.115 (115554881)|CODE_UNIT_STARTED|[EXTERNAL]|06640000000TNPF|VF: /apex/Exception
21:39:36.119 (119492891)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.119 (119575647)|VF_EVALUATE_FORMULA_END
21:39:36.119 (119590598)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.119 (119615591)|VF_EVALUATE_FORMULA_END
21:39:36.120 (120803221)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/img/sites/force_logo.png
21:39:36.120 (120848355)|VF_EVALUATE_FORMULA_END
21:39:36.120 (120935584)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.120 (120965057)|VF_EVALUATE_FORMULA_END
21:39:36.120 (120974637)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.120 (120990629)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121001242)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121017687)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121025388)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121039876)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121056110)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/secur/logout.jsp
21:39:36.121 (121083416)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121107628)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121130764)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121200072)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121224299)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121233994)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121248919)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121305749)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121328132)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121339221)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.121 (121358486)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121580720)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{URLFOR($Resource.SiteSamples, 'img/clock.png')}
21:39:36.121 (121635760)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121684499)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{URLFOR($Resource.SiteSamples, 'img/warning.gif')}
21:39:36.121 (121729667)|VF_EVALUATE_FORMULA_END
21:39:36.121 (121943270)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF| #{$Label.site.get_in_touch}
21:39:36.121 (121990677)|VF_EVALUATE_FORMULA_END
21:39:36.122 (122021392)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|mailto:#{$Site.AdminEmailAddress}
21:39:36.129 (129846299)|VF_EVALUATE_FORMULA_END
21:39:36.129 (129915080)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|mailto:#{$Site.AdminEmailAddress}
21:39:36.136 (136469626)|VF_EVALUATE_FORMULA_END
21:39:36.136 (136797945)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{URLFOR($Resource.SiteSamples, 'img/poweredby.png')}
21:39:36.136 (136857156)|VF_EVALUATE_FORMULA_END
21:39:36.137 (137316766)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/img/sites/poweredby.png
21:39:36.137 (137353875)|VF_EVALUATE_FORMULA_END
21:39:36.138 (138695047)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/site/SiteStyles.css
21:39:36.138 (138733274)|VF_EVALUATE_FORMULA_END
21:39:36.138 (138777708)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.138 (138805219)|VF_EVALUATE_FORMULA_END
21:39:36.138 (138822387)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.138 (138841045)|VF_EVALUATE_FORMULA_END
21:39:36.139 (139151847)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{$Site.Prefix}/site/SiteStyles.css
21:39:36.139 (139182654)|VF_EVALUATE_FORMULA_END
21:39:36.139 (139221824)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{AND(ISPICKVAL($User.UserType,'Guest'), $Site.LoginEnabled)}
21:39:36.139 (139247962)|VF_EVALUATE_FORMULA_END
21:39:36.139 (139258523)|VF_EVALUATE_FORMULA_BEGIN|06640000000TNPF|#{NOT(ISPICKVAL($User.UserType,'Guest'))}
21:39:36.139 (139274861)|VF_EVALUATE_FORMULA_END
21:39:36.242 (141915300)|CUMULATIVE_LIMIT_USAGE
21:39:36.242|LIMIT_USAGE_FOR_NS|(default)|
  Number of SOQL queries: 0 out of 100
  Number of query rows: 0 out of 50000
  Number of SOSL queries: 0 out of 20
  Number of DML statements: 0 out of 150
  Number of DML rows: 0 out of 10000
  Maximum CPU time: 0 out of 10000
  Maximum heap size: 0 out of 6000000
  Number of callouts: 0 out of 10
  Number of Email Invocations: 0 out of 10
  Number of future calls: 0 out of 10
  Number of Mobile Apex push calls: 0 out of 10

21:39:36.242|TOTAL_EMAIL_RECIPIENTS_QUEUED|0
21:39:36.242|CUMULATIVE_LIMIT_USAGE_END

21:39:36.246|CUMULATIVE_PROFILING_BEGIN
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for SOQL operations
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for SOSL operations
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for DML operations
21:39:36.246|CUMULATIVE_PROFILING|No profiling information for method invocations
21:39:36.246|CUMULATIVE_PROFILING_END
21:39:36.141 (141957077)|CODE_UNIT_FINISHED|VF: /apex/Exception
21:39:36.144 (144030919)|EXECUTION_FINISHED

I'm lost.