You need to sign in to do that
Don't have an account?

How to convert all my Leads to Contacts
Hello team,
How can I convert all my leads to contacts without creating new opportunity?
Can somebody give me some example?
Thanks in advance.
How can I convert all my leads to contacts without creating new opportunity?
Can somebody give me some example?
Thanks in advance.
classname.convertLead('00Q9000000vmN7R'); // use your leadID tha you want to convert.
All Answers
public static void convertLead(Id leadId){
Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(leadId);
lc.setDoNotCreateOpportunity(True); // Use this so that you can avoid creating opportunity
LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);
Database.LeadConvertResult lcr = Database.convertLead(lc);
}
}
an erros is shown:
What's wrong?
Thanks in advance.
classname.convertLead('00Q9000000vmN7R'); // use your leadID tha you want to convert.