Loading
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Considerations for Lookup Filters

          Considerations for Lookup Filters

          Follow these guidelines when creating lookup filters.

          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.
          User Permissions Needed
          To manage lookup filters: Customize Application
          • On the Fields page, the Required Lookup Filter icon indicates all fields with active lookup filters. The Required Lookup Filter icon indicates that the lookup filter is required.
          • The lookup filters you create in Salesforce also appear in the partner portal and Customer Portal.
          • Lookup filters are case-sensitive.
          • If you convert a required lookup filter with a custom error message to be optional, Salesforce deletes the message.
          • If you create a lookup filter that invalidates an existing value for that field, the value persists. However, when a user edits the record, Salesforce displays an error message and requires the user to change the invalid value before saving.
          • You can’t save changes that cause required lookup filters on related records to contain invalid values.
          • Versions 16.0 and higher of the Salesforce API support lookup filters. Lookup filters are enforced when you load data through the API.
          • If you configure a lookup filter to show inactive users only, the relationship field has no valid options. Inactive users are never valid for relationship fields that point to the User object.
          • If you create a filtered lookup on a field that looks up to another object, deploy both objects into the organization at the same time.
          • If the field criteria include a master-detail relationship field, lookup field filters don’t work.
          • If the value of a controlling field invalidates the value of a dependent master-detail relationship field, Salesforce doesn’t display an error message.
          • Dependent lookups are supported in Visualforce pages.
          • To create a dependent lookup filter with ServiceResource.ResourceType, use only the first letter of the picklist value, for example T for Technician. See ServiceResource for more details.
          • In Lightning Experience, a lookup filter doesn’t work if a field referenced in the filtered lookup criteria isn't added to the page layout or list view. When a user opens the lookup dialog box, the value being searched is automatically deleted. To avoid this issue, add the missing field that is being used in the lookup field filter criteria to the page layout or list view.
          • Salesforce Knowledge supports lookup filters to and from the Knowledge Article object, with limitations.

            For details about the limitations, seeLookup Filter Limitations - Knowledge Article Object.

          • Value-based filters are supported in Lightning Experience and Salesforce Classic.
          • If an unlocked 2GP package installs a lookup filter, then a later version of the package deletes that lookup filter, the lookup filter isn’t removed from the subscriber org. The lookup filter must be deleted manually instead.
          • When changing ownership of a record in Salesforce Classic, fields on the record that have active lookup filters aren’t validated. As a workaround, we recommend doing lookup filter validation for a record’s fields before changing the record’s owner.

          Lookup Filter Support Limitations - Knowledge Article Object

          There are limitations when using lookup filters to and from Knowledge articles, as outlined here.

          Limitations Using Lookup Filters From the Knowledge Article Object

          Lookup filter limitations from the Knowledge Article Object
          Salesforce Version Lookup Filter Support
          Lightning Experience Supports lookup relationships for custom fields from Knowledge articles to another object (both standard and custom objects).
          Classic Does not support lookup search to any objects (custom or standard objects)

          Limitations Using Lookup Filters to the Knowledge Article Object

          Lookup filter limitations to the Knowledge Article Object
          Lookup Scenario Supported?
          Lookup relationship or Master-Detail relationship using Salesforce Classic with Lightning disabled. No
          Deploying exported Knowledge object metadata using Metadata API for custom lookup fields on custom objects to Knowledge articles. Yes
          Filtering on Search and Recent Knowledge dropdown lists. Filters on the Search and Recent Knowledge dropdown lists are not respected. No
          Saving the lookup selections (from the Recent Knowledge dropdown list) to the default (primary) language Knowledge article version. Yes
          Saving the lookup selections (from the Recent Knowledge dropdown list) to Knowledge article versions other than the default (primary) language Knowledge article version. No
          Selecting and searching on Knowledge articles from the “Recent Knowledge” section when using the Lightning UI. A full search doesn’t return results for any lookup filter used (even when there is no lookup filter applied). This limitation applies to the Lightning UI only. No

          Metadata API Limitations

          For custom lookup fields from Knowledge articles to another object, deploying the exported Knowledge object metadata using a Metadata API leads to the error “Cannot specify 'lookupFilter' for a CustomField of type Lookup for entity Knowledge__kav”.

          Spanning Relationships in Lookup Filters

          Filter criteria can include fields related to the target object (one level only). For example, a lookup field points to a contact. The lookup filter can reference fields on the account related to the contact using the Account Name relationship field. The lookup field can also reference fields on the contact related to the contact via the Reports To relationship field.

          For required lookup filters, each field referenced on a related lookup object counts against the number of unique relationships allowed for the referenced object. The relationships aren’t counted against the source object. For example, the two unique relationships described above count against the number allowed for the Contact object. Optional lookup filters don't count against the limit on the number of unique relationships allowed per object.

          To see which lookup filters affect the limit for a particular target object, from the management settings for the object, go to Related Lookup Filters.

          Lookup Filters vs. Validation Rules

          Validation rules and lookup filters achieve similar ends, but offer different advantages.

          Use a lookup filter:

          • To improve user efficiency by limiting the number of available options in a lookup search dialog.
          • To improve user efficiency by automating filters on lookup search dialogs that your users manually set.

          Use a validation rule:

          • If you're close to the maximum number of lookup filters allowed.
          • To implement a complex business rule that requires you to use a formula. Formulas can reference fields that basic filter criteria can't reference, such as fields on the parent of the source object. Formulas can also use functions. For example, use ISNEW to apply the rule only on record creation, or ISCHANGED to apply the rule only when a field changes.
           
          Loading
          Salesforce Help | Article