function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Eric FortenberryEric Fortenberry 

How to Filter / Restrict Custom Lookup Relationships based on criteria

Is there a way to filter lookup dialog results based on certain criteria?  

 

So for example: 

I have a lookup relationship field for Products on a custom object for a Contact Product Association custom object.  When I click to lookup a product, I am shown all of our products.  I am trying to find a way to restrict the lookup dialog to only show me products in a certain pricebook.  Does anyone know how I could do that?

 

Thanks!

IspitaIspita
Have you tried using Lookup Filter or dependent Lookup filters

With Dependent Lookups, administrators can filter dialog results based on data from other fields, similar to the dynamic behavior of dependent picklists.

Administrators can now use checkbox, number, date, picklist, and lookup fields on the current record in their Lookup Filters to increase end-user productivity. Administration and implementation is easier thanks to sets of a suggested filter tailored to the organization’s schema.
Thanks and regards,
Sapana WSapana W

Hi,

 

On a Contact Product Association object , go to Product lookup field ->Click on Edit ->On edit page scroll down to' Lookup Filter' section ->Click on 'Show Filter Settings'->Here u can specify some filter conditions like say-

 Pricebook  equals value "SomePricebook".

 

Let me know if you face any issue.

 

Thanks