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
AdnanAdnan 

Sum of four fields must equals to fifth...

I was wondering if I can get some assistance a validation rule. I have 4 custom picklist consisting of numbers (1-10). I want to create a validation rule where A+ B+C+D must = E. E will already be populated but the 4 picklist fields number must also equal to E.

 

Hope I was clear.

 

Thanks

Adnan

Best Answer chosen by Admin (Salesforce Developers) 
Steve :-/Steve :-/

Okay, here's what you need to do.  

 

(CASE(PicklistField_A__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0) +
CASE(PicklistField_B__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0) +
CASE(PicklistField_C__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0) +
CASE(PicklistField_D__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0)) <> NumberField_E__c

 

 

 

 

 

All Answers

Steve :-/Steve :-/

Okay, here's what you need to do.  

 

(CASE(PicklistField_A__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0) +
CASE(PicklistField_B__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0) +
CASE(PicklistField_C__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0) +
CASE(PicklistField_D__c,
"1",1,
"2",2,
"3",3,
"4",4,
"5",5,
"6",6,
"7",7,
"8",8,
"9",9,
"10",10,
0)) <> NumberField_E__c

 

 

 

 

 

This was selected as the best answer
AdnanAdnan

This worked like a charm....Thank you so much...

 

This was perfect...