Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Matching Rules entry
How-to guide

Create and activate a custom Matching Rule

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.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated Jun 16, 2026

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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

Objectrequired

The object the Matching Rule applies to. Drives which fields are available and which records it scans.

Matching Rule Namerequired

A label for the rule. Avoid personal data, since it can surface in exports and audit trails.

Matching Criteria (fields)required

Up to 10 fields to compare, each with a matching method and a Match Blank Fields setting.

Matching Equationrequired

The AND/OR expression that combines the field comparisons into the rule's overall match logic.

Gotchas
  • 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.

See the full Matching Rules entry

Matching Rules includes the definition, worked example, deep dive, related terms, and a quiz.