Duplicate Management

Introduction :- 
Maintaining clean and accurate data is one of most challenging thing to improve the productivity.  With new salesforce  matching rules and duplicate rules you can able to manage the duplicate records Duplicate Management to control whether and when users can create duplicate records in Salesforce.
How Duplicate management works? duplicate management working in two different ways based on when user trying to save the new records and when trying to save the edited records.

If new records 

When a user attempts to save a new record, the record is first compared with existing Salesforce records to identify possible duplicates

(1). The criteria used to compare records and identify the possible duplicates are defined by a matching rule. Next, a list of possible duplicates is returned

(2). What happens when the record being saved is identified as a possible duplicate depends on what’s defined in the duplicate rule

(3). For example, the duplicate rule could block users from saving the possible duplicate record or allow them to save it anyway.

Both the Block and Allow options include an alert, which tells users why they can’t save the record and what they need to do. The Allow option includes the ability to report on the duplicate records.

If editing the existing records 

When a user attempts to save an edited record, the record is first checked to see if the user has changed the value of a matching rule field. If so, the duplicate management process works as described for new records. If not, no further action is taken and duplicates are not detected.

Setting Duplicate Management:- 

Setting duplicate management is contained two steps. Setting up the Duplicate rule and Setting up matching rules.

Matching Rules

Matching Rules Matching rules are used to identify duplicate records within Salesforce.

A matching rule is made up of individual fields that are assembled into an equation. Each field contains matching criteria that tell the rule how to compare the fields and what conditions need to be met for the specific field to be considered a match

Goto ->Setup -> Administration-> Matching Rules –> new


Save the matching rule and activate.


The matching rule contains the matching criteria to identify the duplicate cases.Now let’s create a duplicate rule to map the Matching rule.

Duplicate Rules 

Duplicate rules are used to control whether and when you can save duplicate records within Salesforce. Duplicate rules tell Salesforce what action to take when you attempt to create a duplicate record. Each duplicate rule requires at least one matching rule to identify which existing records are possible duplicates. You can configure your duplicate rule to do something when a record is created and edited. However, the rule only runs for edited records if the fields being edited are included in the associated matching rule

The duplicate rule can block you from saving records that have been identified as possible duplicates or allow them to save them anyway. Both the Block and Allow options include an alert, which tells you why you can’t save the record and what you need to do. The Allow option includes the ability to report on the duplicate records

Goto ->Setup -> Administration-> Duplicate Rules –> new .

After saving you can see

Record level Sharing  on Duplicate Rule  

Record level sharing indicated the whether you wanted to enforce the to check the user sharing on data while performing the duplicate check. if you select  “By Pass Sharing rule “ duplicate rule will check at the org level.If you select the  “Enforce Sharing rules” it will check only on user data, not on org.

Actions :-  

The duplicate action is specified on which actions should run on Duplicate record. It can be ” allow ” or “block “

Based on the business decision you can allow the user to create a duplicate record or block them . when you need to allow you have an options show the alert text with the details

Alert Text:-

Alter text will give the details message to the user why he is not able to save the record.

Putting  in action 

Now, let’s test the duplicate management process by creating a new account.

When you create a new account that matching with matching rule salesforce will though an error message as shown below. Based on your duplicate rules you can take the action . in this case we set the “Allow” on creating a with “Alert ” So we can the save the record by ignoring the alert message


Duplicate Record Sets

Duplicate Record Sets tab is the place when you can find all the duplicate records alone with the duplicate Rule which caused to create the record.


Duplicate record sets and duplicate record items can be used to do the following.

  • Create custom report types
  • Create custom fields
  • Write validation rules, triggers, and workflow rules
  • Modify the fields that can appear on the respective page layouts