Hello, do you want to know about “How to create Validation Rules in Salesforce?”. In this post we will discuss about create Validation rules in salesforce, Validation rules in salesforce | Salesforce validation rules, What is a Validation Rule in salesforce, How to Activate / Inactivate a validation Rule.
What is a Validation Rule?
Salesforce validation rules are rules that contain formula expressions that validate our data and return a “True” or “False” value.
- A validation rule contains formula expressions.
- It checks the data entered by the user.
- The validation rule displays an error message to the user when invalid values are entered.
- We can create Salesforce validation rules for Objects, fields, campaign members, and more.
Examples of validation Rules
- The Quantity cannot be negative.
- A field that will only contain specific values.
- Zipcode, phone number to enter in a specific format
Let us check without applying validation rule to quantity field in sample object.
In the Sample object, we have a field called Quantity. Let’s create the record in samples and enter the quantity of the value as negative.
As mentioned above, the quantity field is -5o. In general, the quantity field should not be negative. In this case we have to use validation rules. If the user enters a negative value in the Quantity field, an error message Entering a positive value should be displayed. Here we have to restrict the user by entering a negative value.
How to create Validation rules in salesforce?
To create salesforce validation rules, go to Setup – Build – Create – Objects – Sample – Validation Rules.
Click the new button to create a new validation rule in the Sample object.
- Enter a name for the rule.
- Click the Insert field and enter the syntax.
- Check the syntax whether it contains errors or not. Enter the error message.
- Enter the location of the error.
- Now click the Save button.
After creating a validation rule in Salesforce, we cannot enter a negative value for quantity. If we enter a negative value, an error message will appear at the top of the page as shown above. The record is saved only if the quantity field has a positive value.
How to Activate / Inactivate a validation Rule?
A Salesforce validation rule can be activated or Inactivated. Follow the steps below to Inactivated Salesforce validation rules.
Go to the Object – Validation Rule – Edit the Validation Rule.
Click on the Edit Button
- Uncheck the “Active button” and deactivate the “validation rule” in Salesforce.
- Finally, click the Save button.
Here we clearly understood the How to Create Validation Rules in Salesforce, create Validation rules in salesforce, Validation rules in salesforce. In our upcoming Salesforce tutorials, we’ll learn Roll up Summary Fields in Salesforce.
Create a Formula Field in Salesforce
how to create schema builder in salesforce
Many to Many Relationship in Salesforce
How to Create Lookup Relationship in Salesforce
How to Create Master Detail relationship in Salesforce
Salesforce Object Relationships Overview
How to Create Custom Fields in Salesforce
How to Create Custom Objects in Salesforce
How to Create an APP in Salesforce
Salesforce.com Application Hierarchy
How to Login Salesforce
What is Cloud Computing, Definition, Types, Example
Difference Between ERP and CRM in Salesforce