+ Start a Discussion
KarlyKarly 

Validation Rule Help!!

For example if the first field is 10, the second is 5 and the third is 3, they should get the error message. the second and third added together should match the first..what is wrong???

 

 

IF( The_number_of_Enrollment_Mtgs_Requested__c   = How_many_enrollment_mtgs_did_VMC_conduct__c +  How_many_meetings_did_others_conduct__c   , The_number_of_Enrollment_Mtgs_Requested__c   = How_many_enrollment_mtgs_did_VMC_conduct__c  +  How_many_meetings_did_others_conduct__c ,  The_number_of_Enrollment_Mtgs_Requested__c    >    How_many_enrollment_mtgs_did_VMC_conduct__c +  How_many_meetings_did_others_conduct__c )

SteveMo__cSteveMo__c

So you want them to get an error message if Field_2 + Field_3 do not equal Field_1, or in other words the SUM of meetings conducted must  equal the number of meetings requested?

uzairuzair

If the value of 

The_number_of_Enrollment_Mtgs_Requested__c

is not equal to the sum of

How_many_enrollment_mtgs_did_VMC_conduct__c 

and

How_many_meetings_did_others_conduct__c

it should display an error message means, use the following code :

 

 

NOT(The_number_of_Enrollment_Mtgs_Requested__c   = (How_many_enrollment_mtgs_did_VMC_conduct__c +  How_many_meetings_did_others_conduct__c)) 

 

 

This should help you.

SteveMo__cSteveMo__c

Try something like this:

 

 

The_number_of_Enrollment_Mtgs_Requested__c <> 
(How_many_enrollment_mtgs_did_VMC_conduct__c +  How_many_meetings_did_others_conduct__c)

 One thing that you need to be careful with is blank fields, because they contain NULL so they do add up to anything, you want to make sure that  your numeric fields have a default value of 0.  

 

If you can't have a default value of  0, or there is some other reason why  you need to have fields that are blank, they you'll need to amend the formula to test the fields for blanks before running the Validation Routine. 

 

 

Jeremy_nJeremy_n

I know this isn't what you asked, but what do you think of making the SUM field a simple formula that automatically adds up the other two? That would save some user input and guarantee that it's correct.

 

The formula for this field would just be

 

How_many_enrollment_mtgs_did_VMC_conduct__c +  How_many_meetings_did_others_conduct__c

 

Jeremy

SteveMo__cSteveMo__c

Are you all set now, or do you still need help with anything?