There is no way to stop Account creation on Lead conversion. Objective of lead conversion to create Account and conclude business But you can stop Opportunity creation. You can either create new Account on lead conversion or merge with an existing account. The code or logic to convert lead using apex is:
1. Instantiate - LeadConvert class. Database.LeadConvert dl = new Database.LeadConvert();
2. Some methods that need to be called out - Like: dl.setLeadId('Id of your lead'); dl.setDoNotCreateOpportunity(Boolean); dl.setOwnerId(ID); dl.setAccountId(ID);
//If you wanna merge lead with an existing account
3. Lastly you need to pass this instance to convertLead method: Database.LeadConvertResult result = Database.convertLead(dl);
Important Points: You can leverage this lead conversion technique in trigger or apex class. Keep the code bulkified because convertLead() method count against your DML statements. It is better to pass a list of LeadConvert class into this method.
Objective of lead conversion to create Account and conclude business
But you can stop Opportunity creation.
You can either create new Account on lead conversion or merge with an existing account.
The code or logic to convert lead using apex is:
1. Instantiate -
LeadConvert class. Database.LeadConvert dl = new Database.LeadConvert();
2. Some methods that need to be called out -
Like: dl.setLeadId('Id of your lead'); dl.setDoNotCreateOpportunity(Boolean); dl.setOwnerId(ID); dl.setAccountId(ID);
//If you wanna merge lead with an existing account
3. Lastly you need to pass this instance to convertLead method: Database.LeadConvertResult result = Database.convertLead(dl);
Important Points:
You can leverage this lead conversion technique in trigger or apex class.
Keep the code bulkified because convertLead() method count against your DML statements.
It is better to pass a list of LeadConvert class into this method.