Sub topic 7
Duplicate rules: connecting matching rules to user actions
This chapter assumes you know how to navigate Setup and understand the difference between objects, fields, and records. It also assumes you have read the previous chapters on matching rules. A matching rule decides whether two records look alike. A duplicate rule decides what happens when they do.
What a duplicate rule does
A duplicate rule is a Setup configuration that runs when a user creates or edits a record. It calls one or more matching rules, collects any matching records, and then applies the action you chose. The matching rule never blocks or warns anyone on its own. Without a duplicate rule, a matching rule does nothing during a save.
The parts of a duplicate rule
Each duplicate rule has these settings:
| Setting | Purpose |
|---|---|
| Object | The object whose records the rule checks, such as Contact. |
| Record-Level Security | Whether the rule compares only against records the user can see, or against all records. |
| Actions | What happens on create and on edit: Allow or Block. |
| Alert text | The message shown when the action is Block, or when Allow is paired with an alert. |
| Matching Rules | The matching rule or rules that define a duplicate. Each can compare to a different object. |
| Conditions | Optional filters that limit when the rule runs. |
Actions are set separately for create and edit. A common pattern is to block on create, where a duplicate is easiest to prevent, and to alert on edit, so existing data does not stop people from doing their work.
Creating a duplicate rule
- In Setup, open Duplicate Rules in the Quick Find box and click New Rule.
- Pick the object, such as Contact.
- Name the rule, for example
Contact: Same Email and Name. - Choose Record-Level Security. Select "Enforce sharing rules" if users should only match records they can see.
- Set the actions for create and edit.
- Under Matching Rules, choose the matching rule you built earlier. Add field mappings if you compare to a different object.
- Save, then activate the rule.
A rule that is not active does not run. You can save one in an inactive state while you finish configuring it.
Why the action matters
Blocking is strict. It stops legitimate saves when a match is a false positive, which can frustrate users and break integrations that insert records. Alerting is lenient. Users see the possible duplicates and can choose to save anyway. If you are not sure how accurate a matching rule is, start with Allow and report. Review the results, then tighten the rule.
Exercise
A duplicate rule references a matching rule, but users are never warned when they enter a clearly duplicated Contact. Name two likely causes in the duplicate rule itself.
Show answer
The duplicate rule may be inactive, or its conditions may exclude the record being saved (for example, a filter on record type or owner). The action could also be set to Allow with no alert, in which case the user sees nothing.