You need to sign in to do that
Don't have an account?
mikeegar
ConvertLead call not working even though logs indicate otherwise
Hi,
I have a trigger that converts a lead to an opportunity when the owner is set to a specific queue. When I test it out, everything appears to go fine. I get the page saying that the lead has been converted and has a link to the old lead. If I go to the lead however, it isn't converted. The opportunity isn't created either. According to the logs, the call is successfull and the opportunity is created. The id of the opportunity in the logs is not valid when I try to query for it.
I don't see any errors or anything to indicate the operation got rolledback somehow?
I have tried changing the 'Enforce Validation and Triggers from Lead Convert' setting for Leads but it doesn't seem to make any difference.
Thanks,
Mike
The logs are below. The result of the conversion is can be seen by searching for 'Database.LeadConvertResult'
*** Beginning LeadAutoConversion on Lead trigger event AfterUpdate for 00Q3000000LS5eX 20080929214915.307:Class.Config.getInstance: line 46, column 22: returning from end of method Config<Constructor>() in 0 ms 20080929214915.307:Class.Config.initialize: line 59, column 24: SOQL query with 1 row finished in 4 ms 20080929214915.307:Class.Config.initialize: line 66, column 27: SOQL query with 1 row finished in 32 ms 20080929214915.307:Class.Config.getInstance: line 47, column 9: returning from end of method private void initialize() in 37 ms 20080929214915.307:Trigger.LeadAutoConversion: line 4, column 18: returning Config from method public static Config getInstance() in 37 ms 20080929214915.307:Trigger.LeadAutoConversion: line 5, column 19: returning String from method public String getAutoConversionQueue() in 3 ms 20080929214915.307:Trigger.LeadAutoConversion: line 6, column 43: returning String from method public String getAutoConversionQueue() in 1 ms 20080929214915.307:Trigger.LeadAutoConversion: line 6, column 5: AutoConversionQueue:00G30000001H1R2EAK 20080929214915.307:Trigger.LeadAutoConversion: line 12, column 9: SelectLoop:LIST:SOBJECT:Lead 20080929214915.307:Trigger.LeadAutoConversion: line 13, column 13: l.ownerId: 00G30000001H1R2EAK 20080929214915.307:Class.LeadAutoConversion: line 13, column 34: returning Config from method public static Config getInstance() in 0 ms 20080929214915.307:Class.LeadAutoConversion.<init>: line 26, column 5: SelectLoop:LIST:SOBJECT:Lead 20080929214915.307:Class.LeadAutoConversion.<init>: line 35, column 9: SelectLoop:LIST:SOBJECT:Lead 20080929214915.307:Class.PartnerUsers.<init>: line 14, column 9: SelectLoop:LIST:SOBJECT:User 20080929214915.307:Class.PartnerUsers.<init>: line 14, column 23: SOQL query with 0 rows finished in 7 ms 20080929214915.307:Class.LeadAutoConversion.<init>: line 39, column 22: returning from end of method public PartnerUsers<Constructor>(SET:Id) in 7 ms 20080929214915.307:Class.LeadAutoConversion.<init>: line 40, column 42: returning SET:Id from method public SET:Id getPartners() in 0 ms 20080929214915.307:Class.LeadAutoConversion.<init>: line 40, column 81: returning SET:Id from method public SET:Id getPartners() in 0 ms 20080929214915.307:Class.LeadAutoConversion.<init>: line 40, column 5: m_partnerUsers/CAMs{} / {} 20080929214915.307:Trigger.LeadAutoConversion: line 27, column 38: returning from end of method public LeadAutoConversion<Constructor>(MAP:Id,SOBJECT:Lead, MAP:Id,SOBJECT:Lead) in 8 ms 20080929214915.307:Class.LeadAutoConversion.process: line 50, column 31: returning String from method public String getPartnerTeamMemberAccess() in 3 ms 20080929214915.307:Class.LeadAutoConversion.process: line 51, column 31: returning String from method public String getPartnerTeamMemberRole() in 3 ms 20080929214915.307:Class.LeadAutoConversion.process: line 52, column 31: returning Integer from method public Integer getAssignmentMode() in 4 ms 20080929214915.307:Class.LeadAutoConversion.process: line 54, column 5: assgnMode--------4 20080929214915.307:Class.LeadAutoConversion.process: line 55, column 5: m_Leads--------{00Q3000000LS5eXEAT=Lead:{Status=Open - Not Contacted, SystemModstamp=2008-09-29 21:49:15, LastModifiedByID=00530000001UByQ, IsUnreadByOwner=true, OwnerId=00G30000001H1R2EAK, LastModifiedById=00530000001UByQAAW, LastTransferDate=2008-09-29 00:00:00, IsDeleted=false, CreatedDate=2008-09-29 20:59:55, HasOptedOutOfEmail=false, LastModifiedDate=2008-09-29 21:49:15, DoNotCall=false, HasOptedOutOfFax=false, IsConverted=false, RecordTypeId=0123000000024l4AAA, CreatedByID=00530000001UByQ, Company=test, Id=00Q3000000LS5eXEAT, LastName=test, CreatedById=00530000001UByQAAW}} 20080929214915.307:Class.LeadAutoConversion.getMatches: line 169, column 5: SelectLoop:LIST:SOBJECT:Lead 20080929214915.307:Class.LeadAutoConversion.getMatches: line 175, column 5: SelectLoop:LIST:SOBJECT:Contact 20080929214915.307:Class.LeadAutoConversion.getMatches: line 175, column 22: SOQL query with 0 rows finished in 3 ms 20080929214915.307:Class.LeadAutoConversion.process: line 59, column 39: returning MAP:String,SOBJECT:Contact from method private static MAP:String,SOBJECT:Contact getMatches(LIST:SOBJECT:Lead) in 5 ms 20080929214915.307:Class.LeadAutoConversion.process: line 61, column 32: SOQL query with 1 row finished in 2 ms 20080929214915.307:Class.LeadAutoConversion.process: line 68, column 9: SelectLoop:LIST:SOBJECT:Lead 20080929214915.307:Class.LeadAutoConversion.getNewOwner: line 145, column 35: returning Integer from method public Integer getAssignmentMode() in 0 ms 20080929214915.307:Class.LeadAutoConversion.getNewOwner: line 149, column 24: returning MAP:Id,Id from method public MAP:Id,Id getCAMs() in 0 ms 20080929214915.307:Class.LeadAutoConversion.getNewOwner: line 154, column 33: returning Boolean from method private Boolean isQueue(String) in 0 ms 20080929214915.307:Class.LeadAutoConversion.process: line 71, column 27: returning Id from method private Id getNewOwner(Id) in 1 ms 20080929214915.307:Class.LeadAutoConversion.process: line 90, column 9: leadsToConvert: (Database.LeadConvert[getAccountId=null;getContactId=null;getConvertedStatus=Closed - Converted;getLeadId=00Q3000000LS5eXEAT;getOpportunityName=null;getOwnerId=00530000001UByQAAW;isDoNotCreateOpportunity=false;isOverwriteLeadSource=false;isSendNotificationEmail=true;]) 20080929214915.307:Class.LeadAutoConversion.process: line 91, column 45: Database.convertLead(LIST:Database.LeadConvert, Boolean) *** Beginning LeadAutoConversion on Lead trigger event AfterUpdate for 00Q3000000LS5eX 20080929214915.998:Trigger.LeadAutoConversion: line 4, column 18: returning Config from method public static Config getInstance() in 0 ms 20080929214915.998:Trigger.LeadAutoConversion: line 5, column 19: returning String from method public String getAutoConversionQueue() in 0 ms 20080929214915.998:Trigger.LeadAutoConversion: line 6, column 43: returning String from method public String getAutoConversionQueue() in 0 ms 20080929214915.998:Trigger.LeadAutoConversion: line 6, column 5: AutoConversionQueue:00G30000001H1R2EAK 20080929214915.998:Trigger.LeadAutoConversion: line 12, column 9: SelectLoop:LIST:SOBJECT:Lead 20080929214915.998:Trigger.LeadAutoConversion: line 13, column 13: l.ownerId: 00530000001UByQAAW Cumulative resource usage: Resource usage for namespace: (default) Number of SOQL queries: 5 out of 20 Number of query rows: 3 out of 1000 Number of SOSL queries: 0 out of 0 Number of DML statements: 1 out of 20 Number of DML rows: 1 out of 100 Number of script statements: 338 out of 10200 Maximum heap size: 0 out of 100000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 10 Number of record type describes: 0 out of 10 Number of child relationships describes: 0 out of 10 Number of picklist describes: 0 out of 10 Number of future calls: 0 out of 10 Total email recipients queued to be sent : 0 Static variables and sizes: Config:ASSGN_MODE_CAM:4 Config:ASSGN_MODE_CAM_ST:4 Config:ASSGN_MODE_LEAD:4 Config:DEFAULT_ACCESS:4 Config:DEFAULT_MODE:4 Config:DEFAULT_ROLE:9 Config:MODE_ALL:4 Config:MODE_NON_PARTNER:4 Config:MODE_PARTNER:4 Config:m_instance:1133 LeadAutoConversion:cfg:0 LeadAutoConversion:inQueue:18 LeadAutoConversion:leads:4 LeadAutoConversion:m_Config:0 LeadAutoConversion:m_Leads:26 LeadAutoConversion:m_Shares:4 LeadAutoConversion:m_executionCount:4 LeadAutoConversion:m_instance:4 LeadAutoConversion:m_leadMap:26 LeadAutoConversion:m_oldOwners:44 LeadAutoConversion:m_oppMembers:4 LeadAutoConversion:m_opps:4 LeadAutoConversion:m_partnerUsers:4 PartnerUsers:m_CAMs:4 PartnerUsers:m_isTest:4 PartnerUsers:m_partnerUsers:4 *** Ending LeadAutoConversion on Lead trigger event AfterUpdate for 00Q3000000LS5eX 20080929214915.307:Class.LeadAutoConversion.process: line 91, column 45: DML Operation executed in 629 ms 20080929214915.307:Class.LeadAutoConversion.process: line 92, column 9: lcrs(Database.LeadConvertResult[getAccountId=0013000000M8wYuAAJ;getContactId=0033000000URFYbAAP;getErrors=();getLeadId=00Q3000000LS5eXEAT;getOpportunityId=0063000000MpsKOAAZ;isSuccess=true;]) 20080929214915.307:Class.LeadAutoConversion.process: line 94, column 9: SelectLoop:LIST:Database.LeadConvertResult 20080929214915.307:Class.LeadAutoConversion.process: line 99, column 23: SOQL query with 1 row finished in 5 ms 20080929214915.307:Class.LeadAutoConversion.process: line 101, column 17: l2.ConvertedOpportunityId: 0063000000MpsKOAAZ 20080929214915.307:Class.LeadAutoConversion.process: line 103, column 13: m_oldOwners: {00Q3000000LS5eXEAT=00530000001UByQAAW} 20080929214915.307:Class.LeadAutoConversion.getNewOwner: line 145, column 35: returning Integer from method public Integer getAssignmentMode() in 0 ms 20080929214915.307:Class.LeadAutoConversion.getNewOwner: line 149, column 24: returning MAP:Id,Id from method public MAP:Id,Id getCAMs() in 0 ms 20080929214915.307:Class.LeadAutoConversion.getNewOwner: line 154, column 33: returning Boolean from method private Boolean isQueue(String) in 0 ms 20080929214915.307:Class.LeadAutoConversion.process: line 105, column 27: returning Id from method private Id getNewOwner(Id) in 1 ms 20080929214915.307:Class.LeadAutoConversion.process: line 108, column 17: returning SET:Id from method public SET:Id getPartners() in 0 ms 20080929214915.307:Trigger.LeadAutoConversion: line 28, column 13: returning from end of method public void process() in 657 ms 20080929214915.307:Class.LeadAutoConversion.flush: line 187, column 5: m_executionCount 0 20080929214915.307:Class.LeadAutoConversion.flush: line 188, column 5: m_oppMembers () 20080929214915.307:Class.LeadAutoConversion.flush: line 189, column 5: m_Shares () 20080929214915.307:Trigger.LeadAutoConversion: line 29, column 13: returning from end of method public void flush() in 1 ms Cumulative resource usage: Resource usage for namespace: (default) Number of SOQL queries: 6 out of 20 Number of query rows: 4 out of 1000 Number of SOSL queries: 0 out of 0 Number of DML statements: 1 out of 20 Number of DML rows: 1 out of 100 Number of script statements: 368 out of 10200 Maximum heap size: 0 out of 100000 Number of callouts: 0 out of 10 Number of Email Invocations: 0 out of 10 Number of fields describes: 0 out of 10 Number of record type describes: 0 out of 10 Number of child relationships describes: 0 out of 10 Number of picklist describes: 0 out of 10 Number of future calls: 0 out of 10 Total email recipients queued to be sent : 0 Static variables and sizes: Config:ASSGN_MODE_CAM:4 Config:ASSGN_MODE_CAM_ST:4 Config:ASSGN_MODE_LEAD:4 Config:DEFAULT_ACCESS:4 Config:DEFAULT_MODE:4 Config:DEFAULT_ROLE:9 Config:MODE_ALL:4 Config:MODE_NON_PARTNER:4 Config:MODE_PARTNER:4 Config:m_instance:1133 LeadAutoConversion:cfg:0 LeadAutoConversion:inQueue:18 LeadAutoConversion:leads:26 LeadAutoConversion:m_Config:0 LeadAutoConversion:m_Leads:26 LeadAutoConversion:m_Shares:4 LeadAutoConversion:m_executionCount:4 LeadAutoConversion:m_instance:4 LeadAutoConversion:m_leadMap:0 LeadAutoConversion:m_oldOwners:44 LeadAutoConversion:m_oppMembers:4 LeadAutoConversion:m_opps:4 LeadAutoConversion:m_partnerUsers:4 PartnerUsers:m_CAMs:4 PartnerUsers:m_isTest:4 PartnerUsers:m_partnerUsers:4 *** Ending LeadAutoConversion on Lead trigger event AfterUpdate for 00Q3000000LS5eX Spooling All Immediate Actions Ending All Rules Evaluation Bulk Execute all Immediate Actions *** Beginning Workflow Evaluation User: Admin User Start Time: 20080929214916.048 Starting All Rules Evaluation Starting evaluation of rule type Assignment Starting evaluation of rule type Response Starting evaluation of rule type Workflow Starting evaluation of rule type Escalation End Time: 20080929214916.049 *** Ending Workflow Evaluation