• Samantha Catania
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
When trying to convert a Lead using the standard APEX method we get a DUPLICATE_DETECTED error because there is another Lead with the same email address. The same behaviour is not experianced with the exact same Lead when converting using the convert button on the screen.

Error Message:
System.DmlException: ConvertLead failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate contact. We recommend you use an existing record instead.: []

Apex Code (from SF Example in Doc (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_dml_convertLead.htm))
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId('00Q5t000003eBKzEAM');
lc.setConvertedStatus('Closed - Converted');
Database.LeadConvertResult lcr = Database.convertLead(lc);

Is this a bug in the out of the box method or am I missing something?

 
When trying to convert a Lead using the standard APEX method we get a DUPLICATE_DETECTED error because there is another Lead with the same email address. The same behaviour is not experianced with the exact same Lead when converting using the convert button on the screen.

Error Message:
System.DmlException: ConvertLead failed. First exception on row 0; first error: DUPLICATES_DETECTED, You're creating a duplicate contact. We recommend you use an existing record instead.: []

Apex Code (from SF Example in Doc (https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_dml_convertLead.htm))
Database.LeadConvert lc = new Database.LeadConvert();
lc.setLeadId('00Q5t000003eBKzEAM');
lc.setConvertedStatus('Closed - Converted');
Database.LeadConvertResult lcr = Database.convertLead(lc);

Is this a bug in the out of the box method or am I missing something?