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
Prasanna_24Prasanna_24 

How to skip the validation rules on selecting a checkbox

Hi,

I have a page with checkbox included in it.When this checkbox is selected,it should run the validation rules and display the error messages accordingly.When this checkbox is not selected,it should skip the validation rules and the record should save without displaying errors.

How can i achieve this requirement using before triggers??

Your answers will be highly helpful.
Best Answer chosen by Prasanna_24
badibadi
Yes you can do that, without code
Use if condition in your validation rule
E.g.: IF( NOT(skip_validation_checkbox) , (your validation rule) , false)

so the rule  looks if checkox is checked. if it is then returns false else its checks for the validation condition