Create a Lookup Filter
Follow Along with Trail Together
Want to follow along with an instructor as you work through this step? Take a look at this video, part of the Trail Together series on Trailhead Live.
(This clip starts at the 52:09 minute mark, in case you want to rewind and watch the beginning of the step again.)
From coffee makers and car engines to your email inbox, using filters is an easy way to keep things free of gunk. That’s also true when it comes to keeping your data clean. A lookup filter limits search results, restricting the valid values and lookup dialog results for lookup, master-detail, and hierarchical relationship fields. Use lookup filters to improve data quality by enforcing data consistency.
Set Up Restrictions with Filters
AW Computing’s customer support manager Kenya Collins tasked you with restricting users when they’re selecting a related contact for a case. Set up the case object so users are only able to choose contacts associated with the account from which the case was created.
Create a custom field with a lookup filter.
- From Setup, click the Object Manager tab.
- Click Case, then click Fields & Relationships.
- Click Contact Name, then click Edit.
- In the Lookup Filter section, click Show Filter Settings.
- Click the lookup icon and choose Contact Name, then Account ID, then click Insert.
- Choose equals as the operator.
- In the Value/Field menu, select Field.
- Click the lookup icon and choose Case, then Account ID, then click Insert.
- Ensure the Required radio button and the Active checkbox are selected.
- Click Save.
Now that you’ve set up a filter to aid in your clean data crusade, you’re ready to get down and dirty with process builder.