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
Terry_0101Terry_0101 

How to enforce two fields equals another field

I have a field that must equal two other fields.  How to enforce my users are adding currency correctly?

Example:

Upgrading field = $80
Renewing field = $20

Totals field = $100
Best Answer chosen by Terry_0101
William LópezWilliam López
Hello Samanta,

You have several options, you can create a validation rule:

https://help.salesforce.com/HTViewHelpDoc?id=fields_useful_validation_formulas_number.htm&language=en_US

This way you cna show an error message in case the the sum its not the proper one. 

Formula:
Upgrading_field__c + Renewing_field__c <> Totals_field__c

Error:
The sum of Upgrading field and Renewing field don't match with Totals field 

Here is a video how to do it, it will take you less that 10 mins to get it done:
https://www.youtube.com/watch?v=OzIrZ6azxto

Regards.
​Don't forget to mark your thread as 'SOLVED' with the answer that best helps you. 

All Answers

ShotShot
Is this in VF? If not, just use a workflow (Create > Workflow & Approvals > Workflow Rules).
William LópezWilliam López
Hello Samanta,

You have several options, you can create a validation rule:

https://help.salesforce.com/HTViewHelpDoc?id=fields_useful_validation_formulas_number.htm&language=en_US

This way you cna show an error message in case the the sum its not the proper one. 

Formula:
Upgrading_field__c + Renewing_field__c <> Totals_field__c

Error:
The sum of Upgrading field and Renewing field don't match with Totals field 

Here is a video how to do it, it will take you less that 10 mins to get it done:
https://www.youtube.com/watch?v=OzIrZ6azxto

Regards.
​Don't forget to mark your thread as 'SOLVED' with the answer that best helps you. 
This was selected as the best answer