function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
iegieg 

Why would Lead records have IsConverted true but no Converted Account, Contact, or Opportunity IDs

How can there be records in the Leads table that have the field IsConverted = true but there is no value in ConvertedAccountID, or ConvertedContactID, or ConvertedOpportunityID fields?  I have many records that have this scenario.
Best Answer chosen by ieg
Vijay NagarathinamVijay Nagarathinam
Hello,

If you are using apex code to convert the lead means then you need to set the accountId to convertedAccountId. Use the sample code for your reference.
 
for (Lead lead : leadsToConvert){                
                        Database.LeadConvert lc = new database.LeadConvert();
                        lc.setLeadId(lead.id );            
                        lc.setConvertedStatus( convertStatus.MasterLabel); 
                        lc.setAccountId(emailAccountMAP.get(lead.email.toLowercase()).id); 
}



Let me know if you need any help regarding this.

Thanks,
Vijay