Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Lookup Filter entry
How-to guide

How to add a same-Account lookup filter to a Case Contact field

You define a Lookup Filter on the relationship field itself in Object Manager. The example below restricts a Case Contact lookup to Contacts on the same Account as the Case, the most common dependent-lookup pattern.

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

You define a Lookup Filter on the relationship field itself in Object Manager. The example below restricts a Case Contact lookup to Contacts on the same Account as the Case, the most common dependent-lookup pattern.

  1. Open the field in Object Manager

    From Setup, go to Object Manager and select the object that holds the lookup field, for example Case. Open Fields and Relationships, click the relationship field name such as Contact Name, then click Edit.

  2. Show the filter settings

    In the Lookup Filter section, click Show Filter Settings. This reveals the criteria builder where you add conditions that each candidate record must satisfy.

  3. Build the criteria

    Add a condition comparing a target field to a source field. For the same-Account rule, set Contact: Account ID equals Field and choose $Source.Account ID. Add more rows and combine them with AND or OR if you need several conditions.

  4. Choose required or optional and write the message

    Select Required to block non-matching saves, or Optional to default the dialog while allowing overrides. For a required filter, enter a clear custom error message that names the rule.

  5. Activate and test

    Make the filter active, save, then test by editing a record. Confirm the dialog returns only matching records and that the controlling field sits above the dependent field on the layout.

Filter criteriaremember

The rows that each candidate record must satisfy; reference source fields, target fields, user fields, or fields one hop from the target.

Required or Optionalremember

Required enforces the rule on save and blocks bad values; Optional narrows the dialog by default but lets users show all records.

Custom error messageremember

Shown for required filters when a save fails; write plain text that names the constraint and the related field.

Activeremember

Toggles the filter on or off without deleting it; objects have a cap on active filters, so deactivate unused ones.

Gotchas
  • An empty or short lookup list is often sharing, not the filter; reproduce as the affected user before loosening criteria.
  • Required filters validate on save, so they can reject Data Loader and API records; test those paths before going live.
  • Place the controlling field above the dependent field on the layout, or the dependent filter has nothing to compare against.
  • Tightening a filter can lock existing records that no longer match; report on and backfill them before flipping to required.

See the full Lookup Filter entry

Lookup Filter includes the definition, worked example, deep dive, related terms, and a quiz.