What is a Lookup Filter?
A lookup filter limits which records can be associated within an object relationship.
Why use Lookup Filters?
Use lookup filters to enforce data quality and increase usability within object relationships.
Example
When selecting a venue for a marketing campaign, users should only be able to select approved venues.
I configure the lookup filter on the “Venue” lookup relationship field:
Now, when marketing users select a venue that is not status “Approved”, they cannot save the campaign:
“Unapproved Vendor” was status “Pending”:
When a user searches for a venue through the lookup dialog, only records that match the required criteria are displayed:
Types of Lookup Filters
Required
Required filters (as shown above) require that data within the target record meet the specified criteria. If criteria is not met, the record cannot be saved.
Optional
Optional filters will display a warning during search, but will not outright block the record from being saved:
I noticed that on the Lookup Filter, if I make Filter Type “Optional”, they system will let type anything and in this case , it will create a new record on the Venue object.
It will auto-fill whatever you type in to match an existing record, but it shouldn’t create a brand new record…
Tried to recreate it and couldn’t do it.
Hi John,
We use record types on Accts, Opptys, and Orders that are based on the market channel assigned to the account. Our Price Books are also classified by market channel. I have a custom Lookup field on Accounts pointing to Price Books which is used to set the default price book for each account. I’m not able to find the ability to add a lookup filter for this custom field. Though these are both standard objects on which LU Filters are available, it appears that creating a LU filter on PB from accounts is not available. Do you have any insight on that? Looks like my solution will have to be a Flow.
Thanks,
Chuck
Hey Chuck,
Price book is pretty specialized, it wouldn’t surprise me if that was correct. Sounds like you are thinking about it the right way.
What about creating a pickling field that mirrors your price book selection? You could use process builder to translate that selection to populate the lookup (I think). Not ideal if your price books change often, but probably better from a ui standpoint than adding a flow.
Cheers
John
Hi John,
can you please suggest a video explaining this concept of look up filter
This looks easy to read but tricky to implement.
Regards,
Siva
Here’s one that might help: https://www.youtube.com/watch?v=1R3iMJhr07E
Hi John
In the example above there a small typo:
Example
“When selecting a venue for a marketing campaign, users should only be able to select approved vendors.”
Do you think it should be Venue .
BTW thank you s much for building this Knowledge base 🙂
Thank you, updated. I need to hire an editor one of these days 🙂
Hi John,
Thank you for the resource. My lookup filter works differently. If the venue status is not approved i.e. anything other than “Approved” then it doesn’t show up in the lookup options. Which means there is no chance to see the error message.
Set the filter to Optional instead of Required and you should be able to select additional records as well as see the validation message.
The Operator in the first screen cap is “–None–“. Of course, “Equals” is the choice intended. ;>
Very true Kevin 🙂
Salesforce now has the Lookup Filter Type “Mandatory” renamed to “Required.”
Updated, thanks
On the Lookup filter, should’nt the operator be “equal” so we can read it “Venue: Status” equals “Approved”? (see screenshot)
http://5e2w0vysniohar1b-zippykid.netdna-ssl.com/wp-content/uploads/2012/11/1-14-2013-6-26-59-PM.png
Yes! Thanks Amir- good catch.
Thank you!
Spelling mistake
A lookup filter limits which records can bed associated within an object relationship
Should be records can be associated not bed