I'm looking for some way to disable standard lookup validation that verify if the entered value exist (and throws No matches found if not).

When I enter some value from keyboard into the lookup input, I'd like to be able to create the new lookup value (if it doesn't exist). Any thoughts?

EDIT: The question is about visualforce page of course, I guess there's nothing that could be done on standard layout.

  • 1
    Bart, can you give us some more details? And perhaps some of your apex code? – Sebastian Kessel Jan 13 '16 at 14:22
  • Please see my edit, maybe it's more clear now. I don't think any code would be useful here. – Bart Juriewicz Jan 13 '16 at 14:26
  • This sounds like something you will have to make yourself using a visualforce page and an apex component as a lookup field. – battery.cord Jan 13 '16 at 14:37

I came up with the following solution:

  1. Call JS function j on form save.
  2. Execute JS Remoting method m from within j. Pass lookup field text t as a parameter.
  3. In @RemoteAction check if the record with name t exists and return result.
  4. Now, depending on result you can call some ActionFunction to proceed, or cancel action, or even insert the t with JS Remoting as well.

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.