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
Bryn Leahy 18Bryn Leahy 18 

Require one of two checkboxes = True, based on Record Type

We have two checkboxes "Serviced" or "Not Serviced", in which one will be require to be 'true' in order to save AND Only 1 of the 2 checkboxes can be checked.

The rule will only apply to record types "Work Order 1" or "Work Order 2".

I have attempted it two ways, both pass syntax but do not present an error as they should:
AND
(
$RecordType.Name = "Work Order 1",
$RecordType.Name = "Work Order 2")
IF(
(Not_Serviced__c , 1 , 0)+ IF( Serviced__c, 1 , 0) < 1))

Or
AND

(
$RecordType.Name = "Work Order 1",
$RecordType.Name = "Work Order 2",
Not_Serviced__c ,  Serviced__c
)

Your help is very appreciated.
Sai PraveenSai Praveen (Salesforce Developers) 
Hi ,

Can you try the below validation rule.
AND(OR($RecordType.Name = "Work Order 1",
$RecordType.Name = "Work Order 2"),
(OR(NOT(OR(Not_Serviced__c, Serviced__c)) , AND(Not_Serviced__c, Serviced__c))))

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Thanks,