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
Curley21Curley21 

Enforcing only 1 check box selection with validation rules

Hi,
 
I am really, really pressed for time and I need to use a validation rule to enforce that ONLY 1 check box is selected within a section of our Leads page layout.  Can some provide an example that I could copy, paste and edit?
 
Thank you soooooo much!
 
-Chris
JakesterJakester
Hmmm... depending on the number of checkboxes this could be very complicated. Why not rework it into a picklist? That forces only one choice to be made.

If you must have it be a series of checkboxes, the only thing I can think of is a long series of validation rules. For example, if you had 3 checkboxes called cb1, cb2, and cb3 it would be something like

Code:
or(
    and(cb1, cb2, cb3)
   ,and(cb1, cb2)
   ,and(cb1, cb3)
   ,and(cb2, cb3)
  )

 
Obviously if you have 4 or more checkboxes it will start to really get ugly.