Working with Converted Leads

When submitting S4S Experience Forms data to Salesforce Leads, there is a possibility of submitting data for an existing Lead which has been converted to a Contact. This is how S4S handles this by default:

  1. Lead data is captured in a Sitecore Experience Form and submitted to Salesforce with S4S.

  2. S4S queries Salesforce for an existing Lead using the matching rules configured in the form mapping and also returns the ‘Is Converted’ and ‘Converted Contact ID’ fields.

  3. 1 of 3 things will happen here:

    1. If no Lead is found, then a new Lead will be created.

    2. If a Lead is found and it has not been converted, then the existing Lead will be updated.

    3. If a Lead is found and it has been converted, then the converted Contact record will be updated.

This diagram provides more detail of the process:

Edge Cases (or things to be aware of which could come up in customer testing)

There are some considerations around the way that Salesforce handles converted Leads and what happens when submitting data to converted Leads with S4S. These use cases could be considered problematic for some scenarios.

1. Converted Contact Matching Rule Value has been updated

This occurs during the following scenario where the example Matching Rule for a Lead is ‘Email’:

  1. A Lead is submitted with S4S with the email ‘Jsmith@gmail.com’.

  2. The Lead is converted to a Contact.

  3. The Salesforce Contact Email value is updated to ‘JohnSmith@gmail.com’ by a Salesforce user.

  4. A Lead is submitted again with S4S with the email ‘jsmith@gmail.com’.

  5. The original Lead is matched in Salesforce and the ConvertedContactId is used to find the Converted Contact.

  6. The Converted Contact has it’s email changed back to ‘jsmith@gmail.com’. This may or may not be the behaviour desired by the customer

2. Converted Contact is deleted

An error can occur with S4S Experience Forms when the following example occurs:

  1. A Lead is submitted with S4S with the email ‘HollyThomas@yahoo.com’.

  2. The Lead is converted to a Contact.

  3. The Contact is later deleted.

  4. A Lead is submitted again with S4S with the email ‘HollyThomas@yahoo.com’.

  5. The Lead is matched in Salesforce and the ConvertedContactId is set to the Converted Contact from #2 though the Contact has subsequently been deleted.

  6. S4S attempts to update the Contact which has the ConvertedContactId from the Lead which results in an error because the Contact no longer exists.

Tip: Leads persist in Salesforce, even after they are converted. This is by design. The objects themselves are not visible in the usual lists, but they can be queried.

https://help.salesforce.com/articleView?id=leads_view_edit_converted.htm&type=5

Error Handling

We suggest configuring the S4S Experience Forms Email Error Handling to notify of any errors raised by these edge cases. Please see the linked page for more information - Error Handling

Next Step

Working with Salesforce Duplicate Rules (S4S Experience Forms)

Steps