Duplicate Management in Salesforce Lightning

HandsOn Connect automatically prevents Volunteers or Organizations from creating duplicate records when registering via the public site.  However, administratively, its always possible to create duplicate contact records and duplicate organization records.  Generally, this is not desirable.

Best practice for adding data in Salesforce are for users  to always search for a contact or organization before creating a new record, to avoid creating a duplicate.  But nonetheless, the need to merge duplicate contacts and duplicate organizations does come up frequently.

If you're using the NonProfit Success Pack, there is a special application "Contact Merge" which is the recommended way to merge contacts (as it also handles merging the household accounts that NPSP automatically associates with contacts).  For details on merging contacts if you have NPSP installed, see this article.

Merging accounts and contacts was simpler in Salesforce classic.  See these articles on merging via Salesforce Classic:

Salesforce Lightning however, provides tools that detect duplicates when they appear to be occurring, and provides a way to merge duplicates accounts (and contacts if you're not using NPSP), from within the lightning interface.   It does however, take a bit of administrative setup to handle duplicates in lightning.

This article explains how to create the necessary matching rules, duplicate rules, and page updates to manage duplicates in Lightning, and is recommended as an administrative speedup for those of you needing to manage duplicates in lightning.

Matching Rules: determine when SF should consider that two records may match (might be duplicates)

Duplicate Rules: dictate what to do when matches are detected.   (Note: Its important to allow duplicates to be created (but alert you), as preventing duplicates from being created will cause errors when contacts or accounts are submitted via the public site.  (and HOC will handle preventing duplicates as long as SF doesn't interfere with its built in duplicate prevention).

1. Create Matching Rules for Account and Contact

Matching rules define when to suspect two records are similar and may be duplicates.  Salesforce comes with standard rules for matching accounts, contacts, and leads, and NPSP has its own contact matching rule.  We recommend deactivating each of these, and instead creating a custom Matching rule for HandsOn Connect for Accounts and one for Contacts.   Here's the parameters.

Matching rule for Accounts:

A. Go to Setup / Matching Rules and deactivate any existing matching rules.

B.  Create a new Rule called HOC Account Match.  

  • Set the Object to Account, click next
  • Name the rule HOC Account Match
  • Choose the field Account Name,, set the Matching Method to Fuzzy:Company Name, and leave Match Blank Fields unchecked (false).
  • Save and Activate the Rule.  
All Mailboxes (Found 1,351 matches for search)

Matching Rule for Contacts

  • Set the Object to Contact, click next
  • Name the rule HOC Contact  Match
  • Choose the field Contact: Email ,, set the Matching Method to Exact, and leave Match Blank Fields unchecked (false).
  • Choose the field Contact: First Name, set the Matching Method to Fuzzy, and leave Match Blank Fields unchecked (False)
  • Choose the field Contact: Last Name, set the Matching Method to Fuzzy:Last Name, and leave Match Blank Fields unchecked (False)
  • Set Field logic to EMAIL OR (First Name AND Last Name)
  • Save and Activate the Rule.  

(This basically always considers a duplicate email a match, and also looks for creating contacts with relatively similar First Name and last Name (i.e. Rob Jones and Robert Jones)

All Mailboxes (Found 1,351 matches for search)

2. Create Duplicate Rules

Go to Setup / Duplicate Rules and make sure that Salesforce's "Standard Rule for Contacts with Duplicate Leads" and "Standard Rule for Leads with Duplicate Contacts" are not active.  

Create a new rule, HOC Duplicate Account

Create a rule with the following parameters.  No additional conditions are needed.

Actions should "Allow" creation and editing, and Report but not alert.   (This will prevent errors from occurring when records are created via the public site or sharing portal).

Save the duplicate rule and activate it!

All Mailboxes (Found 1,351 matches for search)

Create a New Rule:  HOC Duplicate Contact

use these parameters, Actions should "Allow" creation and editing, and Report but not alert.

Save and activate this duplicate rule:

All Mailboxes (Found 1,351 matches for search)

3. Add lightning component to Organization (Account) and Contact Lightning Pages

Open any Organization (account) Record.

Click on the Cog in the upper right, and select,  Edit Page

Banners and Alerts

From the list of Standard Components on the left side of the page, drag the component "Potential Duplicates, and place it wherever you'd like on the page layout.  Select "Show Both" as the display option.  (You can choose to just show the card, or show a brief pop-up "toast" when duplicates are suspected.  

Save the layout and activate if necessary.

Banners and Alerts

Repeat this for the Contact Lightning Page Layout(s) you are using.

You'll now receive a notification whenever a potential duplicate exists.

The "Toast" notification pops up briefly and then disappears.  The card persists on the layout.

Click on "View Duplicates" to see the suspected duplicates, which you can then merge if you desire.

Banners and Alerts

When merging contacts, Check the profiles of your duplicate contacts and decide which to make the 'master record"

Look at the duplicates you wish to merge, and see if any HandsOn Contact Profile. (i.e. "Volunteer", "Volunteer Leader", "Partner Staff" is assigned to any or all of the contacts.

Decide which contact you want to make the "Master" contact after the merge.  Remove profiles from the other contacts BEFORE you merge.  You can do remove a profile by selecting "Change profile" and then selecting "None".

After choosing the contacts you wish to merge - Choose the master (winning) contact.  This is the contact that the other(s) will be merged into.  Your master contact should be the one that has a HOC profile.   (If neither have a profile, you can choose either as the master contact).

The other contact records will be deleted after the merge.  Use the "Select All" button to initially select all the values in that contact.  And then scroll down to the page, field by field, selecting any values from the non-master record(s) that you wish to be populated in the merged contact.

After selecting all the values to incorporate in the merged contact, click Merge.


Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.