4

I have a custom visual force page that let you create a new custom object.

In this page there i have a custom lookup to choose the contact.

Do you know if it's possible add a Filter condition to the custom lookup in the controller of the page (select..where)?

Please if you know any code example let me know.

2
  • is the custom lookup a field on your custom object and can you work with the Standard Lookup Filters feature?
    – Seb Wagner
    May 31, 2013 at 8:02
  • Thank you but it's impossible make my query with the standard filter.
    – Enry
    May 31, 2013 at 13:10

2 Answers 2

1

I don't think it is possible to use apex or soql there ;) But you can put together your own "query" for the lookup filter:

enter image description here

This is a soql-like query then. Here you will find some examples:

2
  • Thank you but it's impossible make my query with the standard filter.
    – Enry
    May 31, 2013 at 13:10
  • 1
    @Enry Nope :( But it depends on how complex must be your query. For the simple queries it is a good substitution i think. May 31, 2013 at 13:17
0

You can use Javascript to hyjack the standard lookup action, and instead use your own VF popup page.

You can then do pretty much anything you want, including filters, searches etc. using dynamic SOQL.

Read more on jeffdouglas.com

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .