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.

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

  • Thank you but it's impossible make my query with the standard filter. – Enry May 31 '13 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. – Sergej Utko May 31 '13 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.