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
Jim F.ax281Jim F.ax281 

How can I get LeadID after conversion to existing contact

Hi all,

I've got a managed package with some integration to leads and contacts.  Our custom object has a Lookup relationship to both the Lead and the Contact objects, but neither is required.  In our situation, a record in our custom object is created and is associated to a lead (but not a contact).  When that lead is converted to a contact, we then disassociate that record from the lead and associate it with the contact instead.  We're using a SOQL query to find when this happens, rather than writing triggers within SFDC, because we need to keep our datastore up-to-date as well.  When we convert the lead to a new contact, everything seems to work fine, but when we convert the Lead to an existing Contact, the Lead record is deleted, and in any case the ConvertedContactID for that deleted record remains NULL.  Is there a log of this event that I can query in SOQL?  Any other suggestions?

Thanks, Jim