+ Start a Discussion
Francisco Riccomagno 1Francisco Riccomagno 1 

How to create a lookup filter for an object with Many-To-Many relationship?

Best Answer chosen by Francisco Riccomagno 1
Saurabh DhobleSaurabh Dhoble
The only thing I can think of is to write a custom lookup page in Visualforce, that filters the list according to your criteria.
More details here - http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

All Answers

Francisco Riccomagno 1Francisco Riccomagno 1
My scenario is: Registering a sale where I lookup for Seller and lookup for Product. Seller and Product have a Many-To-Many relationship. I want to filter the products shown related to the Seller I choose, is there a way to do this with Loopup filters?
Francisco RiccomagnoFrancisco Riccomagno
any help at all?
Saurabh DhobleSaurabh Dhoble
Francisco -
This cannot be done using Standard Salesforce. The lookup dialog box searches only specific fields - in case of custom objects, it is only the "Name" field. 
There is a way to do this by using enhanced lookup, but your page needs to be Visualforce for that. Is it a VF page ?
Francisco RiccomagnoFrancisco Riccomagno
This is a Standar Page for a Custom Object. I have enhaced lookup enabled for this lookup although. How can I achieve what I'm lookin for?
Saurabh DhobleSaurabh Dhoble
The only thing I can think of is to write a custom lookup page in Visualforce, that filters the list according to your criteria.
More details here - http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

This was selected as the best answer