Build a custom Matching Rule when the standard rules do not cover your object or your definition of a duplicate. You create and shape the rule first, then activate it, then reference it from a Duplicate Rule so it actually runs on save.
- Open Matching Rules in Setup
In Setup, use Quick Find to open Matching Rules. Make sure any rule you intend to edit is inactive first, because active rules are locked from changes.
- Create the rule and pick the object
Click New Rule, choose the object the rule applies to, and give it a name and description. Keep personal data out of both fields.
- Add matching criteria
Add up to 10 fields to compare. For each field, choose a matching method (exact or fuzzy) and set the Match Blank Fields option. Use only fuzzy or only exact in a single rule, never both.
- Build the matching equation
Combine the fields with AND and OR to express your duplicate logic, for example Email exact OR (Last Name fuzzy AND Company Name fuzzy). Tighten with AND, widen with OR.
- Save and activate
Save the rule, then activate it. Salesforce builds the index in the background and emails you when it is ready. Finally, reference the rule from a Duplicate Rule so it runs.
The object the Matching Rule applies to. Drives which fields are available and which records it scans.
A label for the rule. Avoid personal data, since it can surface in exports and audit trails.
Up to 10 fields to compare, each with a matching method and a Match Blank Fields setting.
The AND/OR expression that combines the field comparisons into the rule's overall match logic.
- A rule must use either fuzzy or exact methods. Mixing both in one rule means no duplicates are detected.
- Activation runs in the background and is not instant. Wait for the confirmation email before relying on the rule.
- Each object caps at 5 active rules, the org caps at 25 active and 100 total, and a Duplicate Rule references at most 3 Matching Rules.
- When the same fuzzy field appears in multiple OR segments, only the last segment is evaluated. Split those into separate rules.
- A Matching Rule allows only one lookup relationship field, which limits how much cross-object disambiguation you can pack into a single rule.