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

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

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

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: