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
JJJenkinsJJJenkins 

Validation Rule based on Percentage Fields

Hey Everyone - 

 

I'm trying to create a validation rule that does the following:

If any of these three % fields have data but the sum of the three fields does not equal 100% I want the record to not be able to save.

AND( 
(OR( 
X1st_Payment__c>0.0, 
X2nd_Payment__c>0.0, 
X3rd_Payment__c>0.0)), 
(X1st_Payment__c+X2nd_Payment__c+X3rd_Payment__c<>1.0) 
)

 That is what I have as of right now but the validation doesn't trigger.

 

Any insights?

 

Thanks,

 

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

(
BLANKVALUE(X1stPayment__c, 0) +
BLANKVALUE(X2nd_Payment__c, 0) +
BLANKVALUE(X3rdPayment__c, 0)
) != 1

All Answers

Ritesh AswaneyRitesh Aswaney

(
BLANKVALUE(X1stPayment__c, 0) +
BLANKVALUE(X2nd_Payment__c, 0) +
BLANKVALUE(X3rdPayment__c, 0)
) != 1

This was selected as the best answer
JJJenkinsJJJenkins

That works. I just had to add that has the last section vs the whole rule

 

Thanks,

Ritesh AswaneyRitesh Aswaney
AND(
(OR(
X1st_Payment__c>0.0,
X2nd_Payment__c>0.0,
X3rd_Payment__c>0.0)),

(
BLANKVALUE(X1stPayment__c, 0) +
BLANKVALUE(X2nd_Payment__c, 0) +
BLANKVALUE(X3rdPayment__c, 0)
) != 1
)