Validation Rule in Salesforce

Aman Garg
2 min readNov 25, 2022

--

What are the Validation Rules

Validation rules verify that the data a user enters in a record meets the standards you specify before the user can save the record. A validation rule can contain a formula or expression that evaluates the data in one or more fields and returns a value of “True” or “False”.

How to Create Validation Rule

  • From Setup, go to Object Manager and click Account.
  • In the left sidebar, click Validation Rules.
  • Enter the following properties for your validation rule:
  • Rule Name: Account_Number_Length_Not_Equal_To_Eight
  • Error Condition Formula
LEN( AccountNumber) != 8
  • Error Message: Account number must be 8 characters long.
  • To check your formula for errors, click Check Syntax.

How many validation rules can be active in Salesforce?

  1. Professional: 20.
  2. Enterprise & Developer: 100.
  3. Unlimited & Performance: 500.

Why we use Validation Rule in Salesforce?

Validation Rules in Salesforce verify that the data entered by a user meets certain criteria before the user can save the record.

Types of Operators Used in Validation Rule

Use these operators and functions when building formulas. All functions are available everywhere that you can include a formula like validation rules.

Note : I am sharing with you module link and some questions for practice so that you will be able to understand how the validation rules work and when it works. Please follow the module and Question and also please share the answer of Question :

  1. Do not close opportunity in past.
  2. A close reason is required when opportunity is closed lost
  3. Customer PO Number Required for closed won
  4. Date of delivery must be no later than 14 days after close date
  5. a custom field called Delivery Date should be provided if an opportunity has advanced to the Closed Won or Negotiation/Review stage.
  6. Opportunity Amount Should not be Blank on prospecting stage.
  7. you want to prevent users from changing the “Case Origin” field after the Case has been created.
  8. Allows a custom field called Commit Amount to be increased but not decreased after initial creation.
  9. Prevents users from changing a custom field called Guaranteed Rate after it has been saved initially.
  10. Validates selected currency against an explicit subset of active currencies in your organization using the Currency picklist

Please Share Answers after completing this Questions. I am very happy to see your answers in the comment box.

Originally published at http://amansfdc.wordpress.com on November 25, 2022.

--

--

Aman Garg
Aman Garg

Written by Aman Garg

Sr. Executive - Training || 6x Salesforce Certified || 2x Copado Certified || Salesforce Mentor || Founder of Salesforce Learners

No responses yet