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
Nagarjuna Reddy NandireddyNagarjuna Reddy Nandireddy 

HOW TO WRITE A VALIDATION RULE FOR THREE LOOKUP FIELDS SELECTION?

Hi All,
I have an object in that three lookup fields.
in that if select one field record will be save.
if i select two or more lookup field record will not show and i want to throw an error.
for this how to write validation rule.please help me

Regards,
Nagarjuna Reddy Nandireddy
Best Answer chosen by Nagarjuna Reddy Nandireddy
sfdcMonkey.comsfdcMonkey.com
hi Nagarjuna Reddy
try this
IF(ISBLANK( LookupField__c1  ), 0,1) +
IF(ISBLANK( LookupField__c2  ), 0,1) +
IF(ISBLANK( LookupField__c3  ), 0,1) > 1
now you select more then 1 lookup field you got an error
Thanks
Mark it best Answer if it helps you :)