function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lisa SchutterLisa Schutter 

Validation with checkbox and 2 possible fields

Hi Guys, I have already this validation rule in place: 

Debit_Authorization__c &&  ISBLANK(IBAN__c)

now we added an extra field which can be filled instead of the IBAN__c field. So if Debit_Authorization__c, IBAN__c or extra field have to be filled. How can I solve this in one validation? 
Best Answer chosen by Lisa Schutter
Hemant_JainHemant_Jain
So you want to throw error only when both fields are blank? Use this then:
AND(Debit_Authorization__c, ISBLANK(IBAN__c),ISBLANK(EXTRA_FIELD_NAME));

 

All Answers

Hemant_JainHemant_Jain
Change the Formula as:
AND(Debit_Authorization__c, OR(ISBLANK(IBAN__c), ISBLANK(EXTRA_FIELD_NAME));
Lisa SchutterLisa Schutter
Hi HermanJain, thank for your awnser, but that doens't work. One of the two is always blank, so the formula is always true. 
Hemant_JainHemant_Jain
So you want to throw error only when both fields are blank? Use this then:
AND(Debit_Authorization__c, ISBLANK(IBAN__c),ISBLANK(EXTRA_FIELD_NAME));

 
This was selected as the best answer
Lisa SchutterLisa Schutter
Yes, thanks! 
tulasiram chtulasiram ch
Error: Incorrect parameter type for function 'AND()'. Expected Boolean, received Text 

AND(Last_Name__c,
       OR(ISBLANK(Phone__c),
             ISBLANK(Email__c)
            )
       ) ...Any one help me why i am getting this error