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
LuLoLuLo 

Validation Rule with Rollup Field throwing error message

Hi All,

I'm trying to create a validation rule based on 3 checkbox fields and a rollup field below are the details:
Checbox field A
Checkbox field B
Checkbox field C
Rollup field 

If "rollup field" = 2 but only 1 of the checkbox fields is check then throw error stating they need to also check Checkbox field B or C. I tried the following but get an error message stating "Incorrect number of parameters for function 'VALUE()'. Expected 1, received 6." Any help is much appreciated.

AND
    (Checkbox_A__c && Checkbox_B__c,
VALUE(
     Rollup_field__c, 2)

Thanks in advance!
Best Answer chosen by LuLo
Ajay K DubediAjay K Dubedi
 Hi Lulo,
Try this,
AND
( 
 OR(
          AND(
               CheckBox_A__c = true,
               CheckBox_B__c = false,
               CheckBox_C__c = false
          ),
          AND(
               CheckBox_A__c = false,
               CheckBox_B__c = true,
               CheckBox_C__c = false
          ),
          AND(
               CheckBox_A__c = false,
               CheckBox_B__c = false,
               CheckBox_C__c = true
          )
  )
  , Rollup_field__c= 2
)
Thanks,
Ajay

 

All Answers

Ajay K DubediAjay K Dubedi
 Hi Lulo,
Try this,
AND
( 
 OR(
          AND(
               CheckBox_A__c = true,
               CheckBox_B__c = false,
               CheckBox_C__c = false
          ),
          AND(
               CheckBox_A__c = false,
               CheckBox_B__c = true,
               CheckBox_C__c = false
          ),
          AND(
               CheckBox_A__c = false,
               CheckBox_B__c = false,
               CheckBox_C__c = true
          )
  )
  , Rollup_field__c= 2
)
Thanks,
Ajay

 
This was selected as the best answer
LuLoLuLo
Thank Ajay! This did the trick, very much appreciated.