Deduplicate Salesforce Leads against Contacts

Salesforce Cross Object Merge Use Case

This post “Deduplicate Salesforce Leads against Contacts” outlines how OneMerge can extend Salesforce Duplicate Management features to implement a realtime check for duplicates between new Leads and existing Contacts (or Person Accounts); a common Salesforce CRM data management use case.

Duplicate Rules, a standard Salesforce feature, support cross-object matching e.g. Lead to Contact and can alert, block or report the creation of duplicates. OneMerge takes this process one step further by enabling Leads to be flagged as duplicates automatically at the time of creation (or edit) and to show the matched Contacts in a related list on a Lead page layout. The main content of this post is the description of the configuration steps required to achieve this exact outcome.

It should be noted that beyond establishing the relationships between Leads and their matched Contacts it is also possible for Leads identified as duplicates to be updated from the matched Contact records using OneMerge Merge Rules. For example, the matched Contact’s parent Account Owner could be copied to the Lead or missing field values could added if the Lead represents a business transaction to be processed irrespective of duplication. A second possibility is the use of OneMerge Platform Events to invoke Flows which notify users or invoke additional business processes.

Before discussing the configuration steps it makes sense to fully clarify the outcome. The screenshot below shows a Lead record that has been matched against the existing Contacts at the time of creation. A single Contact match was identified and reported by Salesforce Duplicate Management and the records were linked and the Lead flagged as a duplicate by OneMerge in realtime. The standard features alone could be used to block the creation of the duplicate Lead or to simply report the existence of the duplication. However in the former case new data points (updated email address or consent status etc.) may be lost by blocking creation of the Lead and in the latter case the follow-on activities for a reported instance of duplication are manual and time expensive.

Lead Matched to Contact

Some of the benefits of flagging Leads as duplicates in realtime on either creation or edit are the prevention of data loss through duplicate blocking, the ability to update matched Contacts with data points from the Lead and vice-versa, the ability to hide or isolate duplicate Leads via standard record visibility rules and the option to invoke process automations to notify users or invoke additional business logic.

Configuration Step 1 – Duplicate Management

Salesforce provides a standard Duplicate Rule named [Standard Rule for Leads with Duplicate Contacts] which enables matching between Leads and Contacts. This Duplicate Rule (shown below) uses the Standard Contact Matching Rule with a mapping for Lead fields.

Standard Rule for Leads with Duplicate Contacts

Configuration Step 2 – OneMerge

The screenshot below shows the required configuration for the OneMerge Merge Ruleset for Lead. It is recommended that the Standard Merge Ruleset is cloned to create a custom rule before customisation.

Please note, for the use case in context, OneMerge features related to merge are being employed to establish record relationships only and for clarity new Custom Fields are used with labels aligned to the functional purpose of deduplication and not merge.

The key settings in context are:

  1. Cross Object Merge Action = “Custom Merge”.
  2. Last Merged Date Field Name = Last_Duplicate_Check_Date__c.
  3. Is Merge Master Checkbox Field Name = Is_Duplicate_Lead__c.
  4. “Lead_to_Contact” Merge Object Mapping.

Lead Merge Ruleset

OneMerge processes the Duplicate Record Sets (DRS) reported by Salesforce Duplicate Rules when the Report checkbox is ticked (shown in the Duplicate Rule screenshot above). DRS can be viewed via the Duplicate Record Sets tab. When OneMerge encounters a DRS with records outside of the Object for which the Duplicate Rule was configured i.e. Contacts for a Lead rule, the Cross Object Merge Action (1) determines whether to ignore the DRS or to process using the Merge Object Mapping (4) for the object i.e. Contact, as shown below.

Merge Object Mapping

Merge Object Mappings define cross-object field mappings for OneMerge Merge Rules and also specify the metadata fields to be set on the matched records. For the deduplication use case the key settings are:

  • Last Merged Date Field Name = Last_Matched_Lead_Date__c. Custom Field: Type=DateTime, Label=Last Matched Lead Date.
  • Master Record Field Name = Last_Matched_Lead__c. Custom Field: Type=Lookup, Object=Lead, Label=Last Matched Lead.

The final configuration step is to activate both triggers and realtime merge via the OneMerge AppSettings. The most convenient approach is via Guided Setup, as shown below.

OneMerge Application Settings

Step 3 – Test

The configuration can be validated by following the test steps outlined below.

Create a test Contact

Test Contact Record

Create a test Lead

In the screenshot below the “Similar Records Exist” alert indicates that the Salesforce Duplicate Rule has identified potential duplicates; this alert can be dismissed via the popup and also suppressed by unticking the Alert checkboxes shown on the Duplicate Rule configuration screenshot above.

New Lead

Validate the outcome

[i] The Contact fields Last Matched Lead and Last Matched Lead Date should be updated.

Test Contact Record Outcome

[ii] The Lead fields Is Duplicate Lead? and Last Duplicate Check Date should be updated.

New Lead Updated Duplicate Fields

[iii] The Lead related list Matched Contacts should show the test Contact.

New Lead Outcome Matched Contacts

Thanks for reading.

Filed under