Loading
Prepare for Email to Become the Default Login ExperienceRead More
Salesforce Enforces New Security Requirements in Summer 2026Read More
Extend Salesforce with Clicks, Not Code
Lookup Filters Best Practices

Lookup Filters Best Practices

Use these best practices when you create your lookup filter.

Required Editions

Important
Important Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.
Available in: both Salesforce Classic and Lightning Experience
Available in: All Editions except for Database.com.
Custom Help
Define custom help for fields with lookup filters to let users know about the business rule the filter enforces. For example, if the lookup filter restricts the Account Name on opportunities to only allow active accounts, define custom help that states You can only associate active accounts with opportunities.
Error Messages
To guide users who type invalid values, customize lookup filter error messages. For example, if the lookup filter restricts the Account Name on opportunities to only allow active accounts, define an error message that states Value doesn't exist or isn't an active account.
Important
Important Salesforce translates the standard error message for required lookup filters, but not custom error messages. Use the Translation Workbench to translate lookup filter custom error messages. To restore the standard error message after modifying it, click Reset to default message.
Working with Master-Detail Relationship Fields
When creating a lookup filter on a master-detail relationship field, verify that the current values of the field on all of the detail records meet the criteria you specify. If you specify criteria that an existing value doesn't meet, Salesforce prevents the user from saving changes to the detail record. If this occurs, the user must first modify the value on the master record to meet the criteria. For example, consider a custom object with a master-detail relationship field that points to accounts. If you define a lookup filter that excludes all accounts with a Create Date before 01/01/2009, verify that no existing records of that custom object have a master-detail relationship with any account created before 2009. A quick way to do this is to create a report that shows all accounts with a Create Date before 01/01/2009.
Profile-Based Lookup Filters
When you reference the User object, such as Current User, use Profile: ID in filter criteria to define different filter criteria for different users (example: Current User Profile: ID), or to let administrators enter values that don't match the criteria. Avoid using Profile: Name due to technical limitations on standard and custom profiles.
If you enter Current User Profile: Name or Profile: Name in the Field column of your lookup filter criteria, Salesforce displays a lookup icon in that row. To select from a list of existing profiles rather than typing profile names, click the lookup icon.
Record IDs vs. Record Names
To reference a specific record in filter criteria, use the ID of the record instead of its name. IDs are always unique whereas names aren’t.
Testing
After creating a lookup filter, test it to make sure it isn’t too restrictive. Depending on their permissions, some users have read-only access to some relationship fields; ensure your lookup filters don't prevent those users from editing records critical to their job functions.
Dependent Lookups on Page Layouts and Mini Page Layouts in the Console
When designing page layouts with dependent lookups:
  • If a dependent lookup is above its controlling field on a layout, make its lookup filter optional or redesign the layout. Moving a required dependent lookup above its controlling field can confuse users who typically start from the top of a page when entering data.
  • Ensure that both the controlling and dependent fields are visible so users can correct invalid values.
Lookup Filters and the Lookup Filter Fields Search Layout
Don’t reference the same fields in both lookup filter criteria and the Lookup Filter Fields search layout. Users might assume that results from their custom search override administrator-controlled lookup filters.
 
Loading
Salesforce Help | Article