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
Srinivas CSrinivas C 

convert lead to custom object

Hi,
I have standard objects Lead, Account, Contact and
custom object Opportunity__c , after the lead conversion need to create records in account , contact and custom opportunity records.
please help me out in the solution with the required code.

thanks,
srinivas 
SwethaSwetha (Salesforce Developers) 
HI Srinivas,
The coding approach should be that
"You will need to write a trigger on lead object. There is a flag field "isConverted" on lead to decide whether it is converted.

Write trigger on update event of lead. Compare trigger.old value and trigger.new value of isConverted flag. Then you can insert objects as you want into you custom opportunity object."

In case you want to try an app exchange package, check 
Custom Object Lead Conversion(https://appexchange.salesforce.com/appxListingDetail?listingId=a0N30000003GuisEAC)

Related: https://salesforce.stackexchange.com/questions/76110/convert-lead-to-custom-object-opportunity-and-contact

Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful. Thank you
Dima Ivanov 17Dima Ivanov 17

Hi Srinivas C,

In case you want appexchange solution please try: Blink: Mass & Auto Convert Leads, Lead to Custom Object, Manage Lead Record Type (https://appexchange.salesforce.com/appxListingDetail?listingId=a0N3A00000G0nBzUAJ" target="_blank