we have a lookup on custom object to opportunity with lookup filter to only show open opportunities.But, at some point the user closes the opportunity and comes back to update a text area field on the custom Object record. At this point, the lookup filter validates the opportunity and throws an error message value does not match filter criteria.

Any work arounds to validate filter criteria on create but not on edit?

PS:We are using lightning and creating lookup dialog components and customizing the record detail is a lot more effort.

1 Answer 1


Unfortunately, filters are all or none. You would have to come up with an alternative means rather than using just a lookup filter, such as a validation rule. That might look like:

AND(ISCHANGED(Opportunity__c), Opportunity__r.IsClosed)

This rule states that when the opportunity field changes, and the new opportunity selected is closed, present an error. This way, you can make the opportunity field lookup filter optional; if they select a wrong value, the validation rule will stop them instead of the lookup filter.

  • That makes sense but, we do need the filters because, there are hundreds of opportunities and we only want to show the ones appropriate.
    – Venkata
    Aug 20, 2018 at 16:08
  • @Venkata Yes, you need to make the filters "optional", and rely on the validation rule to enforce the logic.
    – sfdcfox
    Aug 20, 2018 at 16:08

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.