0

I am trying to create a validation rule which checks whether Field A OR Field B or no field is filled in. Basically, we want to disallow that both fields are filled in at the same time. I have created the below validation rule, but it gives me an error when I try to leave both fields blank. Is there an easier way of expressing this?

OR( 
AND(checkbox__c , NOT(ISBLANK(Lookup__c))), 
AND(NOT(checkbox__c), ISBLANK(Lookup__c)), 
AND(NOT(checkbox__c), NOT(ISBLANK(Lookup__c))))
1

What I can understand from your below statement is that you want to throw an error when both the fields are filled.

we want to disallow that both fields are filled in at the same time

If that's the case, then your validation rule should be something like this

AND(checkbox__c, NOT(ISBLANK(Lookup__c)))

Assuming checkbox__c is a checkbox field, hence above rule will fire only when checkbox is checked and lookup field has a value in it.

| improve this answer | |

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.