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 Answer 1

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.

You must log in to answer this question.

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