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
MrTheTylerMrTheTyler 

Custom Object Linked to Lead

If I create a custom object record that is linked to a lead and then that lead is converted to an opportunity and account, can I somehow traverse from the account or opportunity back to the originating lead and finally to the custom object?

 

 

Cheers,

 

 

Tyler

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney
When a lead is connverted the isconverted field on it gets set to true. Also the convertedcontactid and convertedaccountid fields are populated to hold the respective contact and account ids. So potentially you could grab them via apex in a trigger. Alternatively just stamp this object id on the account and contact at the time of lead conversion via an apex trigger and it will then always be accessible even via config

All Answers

Ritesh AswaneyRitesh Aswaney
When a lead is connverted the isconverted field on it gets set to true. Also the convertedcontactid and convertedaccountid fields are populated to hold the respective contact and account ids. So potentially you could grab them via apex in a trigger. Alternatively just stamp this object id on the account and contact at the time of lead conversion via an apex trigger and it will then always be accessible even via config
This was selected as the best answer
MrTheTylerMrTheTyler

Solid advice.  Thank you very much!

 

 

Cheers,

 

 

Tyler