+ Start a Discussion

How to create a filtered lookup in Visualforce Page

Hi ,


I have a requirement where we need to show a lookup field with a filter criteria to show Accounts in a vf page on lead Object.The field does not exist in lead object.Can anyone please suggest me how to create a filtered lookup field on VF Page.



Any help would be highly appreciated


Thanks in Advance



You can add Look Up filters in the object level.

Go to the lookup field -> Lookup filter -> Show Filter Settings


then you can add filters.


If this post is helpful please throw Kudos.If this post solves your problem kindly mark it as solution.


Have a look at this salesforce link http://login.salesforce.com/help/doc/en/fields_lookup_filters_defining.htm

This explains the every step involved

This link describes how to create a lookup filter.My question is creating a lookup in vf page with filter criteria.This field does not exist at object level.We have to just show it vf page.





Have a look here http://blog.jeffdouglas.com/2011/08/12/roll-your-own-salesforce-lookup-popup-window/

You can customize this code by changing the query according to your filters.
Mike ArthurMike Arthur
I interpret the question not as 'how do I create a filtered lookup' but how do I get the filtered lookup to work when added to a VF page'.

Samuel has answered it here: