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
mamamama 

For CheckBox validation

Hi,

   It is urgent .Please Help.

 

My requirement is:

         I have 4 checkboxes are there in Lead  and also  Percent field. When any of the checkboxes are getting selected the value in the percent field will go on increasing. How to write the validation rule for this one? Please help as soon as possible.

 

 

Jerun JoseJerun Jose

What you are asking for doesnt look like a validation.

 

If the value in the percent field should be increased when a checkbox is selected, then this should be done with a workflow field update.

 

If you want to check if the value in the percent field has been increased when a checkbox is selected, then use the formula below

 

AND(
  OR(
    AND( ISCHANGED(checkbox1), Checkbox1 = true ),
    AND( ISCHANGED(checkbox2), Checkbox2 = true ),
    AND( ISCHANGED(checkbox3), Checkbox3 = true ),
    AND( ISCHANGED(checkbox4), Checkbox4 = true )
  ),
  ( PRIORVALUE( percentField ) >= percentField )
)

 This validation will fire, if any of the checkboxes have been set to true from false and if the value in the percent field has not been increased

Jake GmerekJake Gmerek

You could probably also do this with a formula field:

 

(if(checkBox1__c, 1, 0)+if(checkBox2__c, 1, 0)+if(checkBox3__c, 1, 0)+if(checkBox4__c, 1, 0))*25

 

 

Shashikant SharmaShashikant Sharma

Do you want to validate or wants a formula for percentage increament? 

goabhigogoabhigo

Jake Gmerek's formula will do the the work. But the percentage will only be displayed after the record has been saved. And remember formula fields are not editable.