AnsweredAssumed Answered

Merged Leads can cause lead id to be invalid for an activity

Question asked by 14988 on Jan 22, 2013
I noticed that our lead synching software written in Java was getting stuck.

A SOAP call in java was returning a "MktServiceException: 20103 - Lead not found exception" when looking up the full details of the lead involved in activites that had happened even recently (eg filling out a form).

I tracked it down to getLeadChanges returning an anonymous users' LeadID in the form activity itself, but just following that activity of the form fillout, that lead is merged with an existing user who had a different previously created LeadID.

There didn't seem to be an easy way to check for that 20103 error code only so I had to modify the marketo client code to expose the SOAPFault's getFaultString() method in the MktServiceException class.  It still has the "- Lead not found exception" appended onto the end, maybe there's a better method to get just the code # itself?

Searching for getLeadChanges with a filter for ActivityType.MERGE_LEADS following that form fillout will help matchup the old no longer existing lead's id (from "Merge ID" field) to the new Lead's id ("Lead ID" field) from that merge activity record that just followed the form fillout.

I hadn't noticed this issue crop up before, and maybe it's just the first time I've run into it but it seems strange that it's happened a number of times since.  It first happened around Jan 12, 2013..  was there a change to the activity records relating to the merged field activity?

If not, maybe this will help someone else who runs into the same problem in their code.