Hey guys, today in this post we are going to learn about How to Write a Validation Rule on Lead for the Annual Revenue Field is Mandatory before Lead Status Change to “Closed – Converted” Stage in Salesforce.
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 contains a formula that evaluates the data in one or more fields and returns a value of “True” or “False”. Validation Rules also include an error message to display to the user when the rule returns a value of “True” due to an invalid value. To Know more details about Validation Rule, Click Here.
Final Output →
Other related post that would you like to learn in Salesforce
- Find the below steps ▾
Step 1:- Require Validation for Converted Leads on Lead Settings
Make sure this setting is enabled, otherwise Validation Rule on Lead conversion will be ignored.
Follow the below steps to enable Lead Settings
Setup >> Quick Find >> Lead Setting
Annual Revenue Validation
Step 2:- Create a validation rule in Lead using Error Condition Formula.
Follow the below steps to create validation rule on Leads
Setup >> Object Manager >> Lead >> Validation Rule
Don’t forgot to make enabled Active of checkbox.
IF( ISPICKVAL( STATUS, 'Closed - Converted'), ISBLANK( AnnualRevenue ), NULL)
Set Error Message in Validation Rule
Step 3:- Set Error Message and Error Location in Validation Rule.
Further post that would you like to learn in Salesforce
What is the validation rule on a lead object in Salesforce?
To enforce a Validation Rule when converting leads, you need to enable 'Require validation for Converted Leads. ' Note: If the 'Require validation for Converted Leads' setting is not available, please contact Salesforce Support to enable the 'Use Apex Lead Convert' permission.
Do validation rules get enforced on the lead conversion?
Validation rules are enforced on lead conversion for the Lead, Account, Contact, Opportunity objects. This is only true if the 'Require Validation for Converted Leads' setting is checked.
How do you bypass the validation rule during lead conversion?
When Lead convert if users choose Create New' then validation rule on lead needs to run if they choose 'Choose Existing' validation rule don't need to run. So i created check box on lead with unchecked. After that i created trigger to bypass validation rule.