How to implement lookup filters on Salesforce

intermediate 8 min read Updated 2026-03-18
Quick Answer

Lookup filters in Salesforce restrict the records users can select in lookup fields based on specific criteria. They're implemented by navigating to the lookup field settings in Setup and configuring filter conditions using field values or user context.

Prerequisites

  • Access to Salesforce Setup
  • Customize Application permissions
  • Understanding of object relationships
  • Knowledge of Salesforce field types

Step-by-Step Instructions

1

Navigate to the Object Manager

Click the Setup gear icon in the upper right corner and select Setup. In the Setup menu, navigate to Object Manager and select the object that contains the lookup field you want to filter.
Use the Quick Find box to search for 'Object Manager' if you can't locate it in the menu.
2

Access the Lookup Field Settings

Click on Fields & Relationships from the object's menu. Locate your lookup field and click on its Field Label to open the field detail page. Then click Edit to modify the field settings.
If you don't see the lookup field, ensure you're on the correct object that contains the field.
3

Enable Lookup Filter

Scroll down to the Lookup Filter section in the field edit page. Check the Enable Lookup Filter checkbox. You'll see options to configure filter criteria and error messages.
4

Configure Filter Criteria

Click Add Filter Logic to define your filtering conditions. Select the Field from the target object, choose an Operator (equals, not equal, contains, etc.), and specify the Value. You can use:
  • Field values from the current record
  • User context variables like $User.Id
  • Static values
  • Formulas for complex logic
Use the 'Insert Field' button to reference fields from the current object or user context.
5

Set Filter Logic and Error Messages

If you have multiple filter criteria, define the Filter Logic using AND/OR operators (e.g., 1 AND 2 OR 3). In the Error Message field, enter a user-friendly message that explains why certain records aren't available for selection.
Keep error messages clear and actionable to help users understand the filtering restrictions.
6

Configure Optional Settings

Set additional options:
  • Show All Records: Check this if administrators should see all records regardless of filters
  • Enforce on UI Only: Limits filtering to the user interface, allowing API operations to bypass the filter
Review your settings and click Save.
Test with different user profiles to ensure the filter works as expected for all user types.
7

Test the Lookup Filter

Navigate to a record of the object containing the lookup field. Click the lookup icon next to the field and verify that only records matching your filter criteria appear in the search results. Try entering different search terms to confirm the filtering is working correctly.
Test with different user profiles and record types to ensure comprehensive functionality.

Common Issues & Troubleshooting

Lookup filter not appearing in field settings

Ensure the field is actually a lookup or master-detail relationship field. Lookup filters are only available for these field types, not for text or other field types.

Filter criteria not working as expected

Check your field references and ensure they point to valid, accessible fields. Verify that the referenced fields have the correct API names and that users have read access to these fields.

Users can't see any records in lookup

Review your filter logic for overly restrictive criteria. Check that the Show All Records option is appropriately configured and verify user permissions on the target object.

Lookup filter causing performance issues

Ensure referenced fields are indexed and avoid complex formula expressions. Consider using selective filters that reduce the dataset size and contact Salesforce support if performance issues persist.

Prices mentioned in this guide are pulled from current plan data and may change. Always verify on the official Salesforce website before purchasing.