How to enable Duplicate prevention upon manual entry in Salesforce Lightning

Last published at: 2022-02-08 10:41:57 UTC
Delete

If you are using the Classic version of Salesforce please read this article.

Delete

When using Duplicate Prevention in the standard Lightning Entry page, Duplicate Check is limited to showing only a text message. If you want to show the actual duplicate records in Lightning, we need to replace the native entry page with the DC Entry Lightning Component. This article will show you how.

Duplicate prevention upon manual entry

Step 1 How to replace the native entry page with DC Entry page

  1. Navigate to Salesforce Setup  menu.
  2. From 'Platform Tools' click on 'Objects and Fields' then choose 'Object Manager'.
  3. Find the Object you want to use the DC Entry Lightning Component with. 
  4. Navigate to 'Buttons, Links, and Actions'.
  5. Find 'New' and click 'Edit'.
  6. At "Lightning Experience Override", select the 'dupcheck:dc3RecordForm' Lightning Component and click 'Save'.
  7. Find the 'Edit' button and click 'Edit'. 
  8. At "Lightning Experience Override", select the 'dupcheck:dc3RecordForm' Lightning Component and click 'Save'. 

Step 2 Enable Duplicate prevention upon manual entry in Salesforce Lightning

  1. Navigate to DC Setup in the Duplicate Check application.
  2. Navigate to the particular object you want to enable prevention upon manual entry for.
  3. Navigate to the Scenario tab and make sure that you have applied the scenario to 'Manual Insert Prevention'. If you want Duplicate Check to trigger upon editing a record as well, apply the scenario to 'Manual Update Prevention'.

Step 3 Option to hard-block the user for creating duplicate records

  1. Go to DC Setup - Settings.
  2. At 'Duplicate Prevention in Native Entry Page Lightning', make sure the toggle switch is set to 'Enabled' if you do want to hard-block the user for creating the record when duplicates are found.
  3. The user can bypass this hard-block by checking the 'Disable Duplicate Check' checkbox.
  4. At 'Duplicate Prevention in Native Entry Page Lightning', make sure the toggle switch is set to 'Disabled' if you do not want to hard-block the user for creating the record when duplicates are found.
Delete

For non-standard and custom objects, you need to create the 'Disable Duplicate Check' checkbox and the hard-block will only work when the Apex Trigger is created. Find out how in steps 6 and 7 of this article.

Delete

Duplicate Check now returns potential duplicate records while you are filling out the form. Duplicate Check decides what a duplicate record is, and how to compare your new entry, based on the applied scenario. Learn more about scenarios here.