0

I am trying to create a formula that restricts multiple checkboxes from being ticked. User should only be able to tick one checkbox per record. I've managed to create the formula that handles this functionality but I cannot seem to figure out how to add a specific record type for it. Here's what I've Got so far

IF (Lighting_Only__c , 1, 0) + 
IF ( Accessories_Only__c , 1, 0) + 
IF ( Accessories_Small_Furniture__c , 1, 0) +
IF ( All_Product_Categories__c , 1, 0)) > 1

Can anyone help assist me adding the $recordtype name = 'Dealer' on above formula?

1 Answer 1

1

Besides summig the result of the field checks, you could add an AND operator to check for the record type:

RecordType.DeveloperName == 'Dealer'

This way, when the record type is "dealer" and one of the fields is ticked, your validation rule should be triggered.

Also, you should consider getting those fields transformed into a picklist field, since only one of them can be ticket at the same time. This kinda looks like the behavior for a picklist field.

3
  • 1
    They're trying to make sure at most one box is checked, so your formula isn't quite right.
    – sfdcfox
    Commented Apr 29, 2019 at 2:23
  • 2
    I tried that out and unfortunately now it fires even with just 1 checkbox ticked. should only fire when 2 or more checkboxes are ticked Commented Apr 29, 2019 at 2:24
  • I reviewed my post, please take a look again. You can reuse your previous formula, I think. Commented Apr 29, 2019 at 2:26

You must log in to answer this question.

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