Hey guys, today in this post we are going to learn about How to write a Validation rule for StageName of opportunity sObject that don’t allow the user to move Previous/Next Stage Name based on User/Profile and record type (Except specific profile of user) in Salesforce
➡ Real time scenarios:- Write a Validation rule to Stop/Prevent the next and previous stages name of opportunity sObject based on specific profile/user and record type in Salesforce
➡ Note:- Only “Custom: Support Profile” of Profile of User can allow the change the Stage Name and the record type “developerName” should be (ecom_record_Type).
Other related post that would you like to learn in Salesforce
- Find the below steps for this post.
Opportunity Validation Rule
Step 1:- Create Validation Rule : Opportunity_Stage_Validation
Setup >> Object Manager >> Opportunity >> Validation Rule
Opportunity_Stage_Validation [Opportunity Validation Rule]
$Profile.Name <> 'Custom: Support Profile',
RecordType.DeveloperName = 'ecom_record_Type',
/*Only Custom: Support Profile user allow can change the stage*/
Further post that would you like to learn in Salesforce
Where are validation rules in Salesforce?
* From Setup, go to Object Manager and click Account. * In the left sidebar, click Validation Rules. Click New. * Enter the following properties for your validation rule: ... * Error Message: Account number must be 8 characters long. * To check your formula for errors, click Check Syntax.
Why do we use validation rule?
A validation rule is one way to restrict input in a table field or a control (such as a text box) on a form. Validation text lets you provide a message to help users who input data that is not valid. ... For example, the Field Size property of a field restricts input by limiting the amount of data.
How do I bypass a validation rule in Salesforce?
Update the validation rule you want the process or flow to bypass by adding a check for the Is Automation Bypassed? field is set to false. If IsAutomationBypassed = true (which your process or flow will update for the formula checkbox to evaluate to true), then the validation rule will be bypassed.
How many types of validation rules are there in Salesforce?
There are five types of Rules in salesforce and the priority of each rule is according to their order.