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?
- Professional: 20.
- Enterprise & Developer: 100.
- 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.
- Math Operators
- Logical Operators
- Text Operators
- Date and Time Functions
- Logical Functions
- Math Functions
- Text Functions
- Summary Functions
- Advanced Functions
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 :
- Validation Rule Module
- 10 Validation Rule Questions
- Do not close opportunity in past.
- A close reason is required when opportunity is closed lost
- Customer PO Number Required for closed won
- Date of delivery must be no later than 14 days after close date
- a custom field called Delivery Date should be provided if an opportunity has advanced to the Closed Won or Negotiation/Review stage.
- Opportunity Amount Should not be Blank on prospecting stage.
- you want to prevent users from changing the “Case Origin” field after the Case has been created.
- Allows a custom field called Commit Amount to be increased but not decreased after initial creation.
- Prevents users from changing a custom field called Guaranteed Rate after it has been saved initially.
- 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.