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
AnonymouseAnonymouse 

How to Create Validation Rule of Either Field One Filled Or Field Two Filled But Not Both Filled

Hello,

I have two fields (example: fieldOne__c and fieldTwo__c). If both fields are filled out, I want an error to pop up. How may I do this? Any help would be greatly appreciated.

Sincerely,
Anon
Best Answer chosen by Anonymouse
Asitha_RajuAsitha_Raju
Hi Anon,
You can try the given validation rule:
AND(!ISBLANK( fieldOne__c ), fieldTwo__c = true)

Please note:  fieldOne__c is the Number field and fieldTwo__c is the checkbox field. If this solves your issue, then please mark it as the best answer.
Thanks

All Answers

AnonymouseAnonymouse
Hello,

I forgot to mention that one field is a number field and the other field is a checkbox field.

Sincerely,
Anon
Asitha_RajuAsitha_Raju
Hi Anon,
You can try the given validation rule:
AND(!ISBLANK( fieldOne__c ), fieldTwo__c = true)

Please note:  fieldOne__c is the Number field and fieldTwo__c is the checkbox field. If this solves your issue, then please mark it as the best answer.
Thanks
This was selected as the best answer
AnonymouseAnonymouse
Hi Asitha,

Thank you! This works perfectly!

Sincerely,
Anon