Validation Rules in Salesforce

Validation Rules in Salesforce

In order to make your data cleaner and more actionable, setting up data validation rules is important. You can save time for yourself and your teammates by ensuring that data is entered correctly the first time.

Validation Rules help you enhance the quality of your data by verifying that the data entered by a user meets the specified standards and requirements. If the data doesn’t meet your specifications, then the user cannot save their changes to the record.

What is the Validation Rule?

A Validation Rule is a rule on a field which verifies that data entered by a user meets certain criteria before the user can save the record. The rule asks a Yes or No question where the answer must be “Yes”, or “True”. The question is asked when a user enters new data into Salesforce and goes to save the record changes.

There are several functions we can use while creating a Validation rule.

How to use Validation rules?


Validate if the Phone Number or Mobile Number should not be empty if the Rating is Hot.



ISPICKVAL( Rating , “Hot”) , ISBLANK(Phone))

Validation Rules in Salesforce
Validation Rules in Salesforce1

Now here, in the above screenshot, you can see that due to validation rule the record cannot be saved as the Phone field is empty. So in order to save the file, the user needs to fill that field.

Error Message: The phone field cannot be empty.

Error Location: Phone

After you have defined validation rules:

The user chooses to create a record or edit an existing record.

  1. The user clicks Save.
  2. All validation rules are verified.
  3. If all data is valid, the record is saved.
  4. If any data is invalid, the associated error message displays without saving the record.
  5. The user makes the necessary changes and clicks Save again.

You can specify the error message to display when a record fails validation and where to display it. For example, your error message can be “The close date must occur after today’s date.” You can choose to display it near a field or at the top of the page. Like all other error messages, validation rule errors display in red text and begin with the word “Error”.


When dealing with a lot of information in Salesforce, it is helpful to have a validation rule to make sure the data is correct, rather than having users looking through reports to make sure the information you entered is as it should be. Validation rules help you maintain data integrity and prevent changes that shouldn’t be made.

Validation rules are the best way to improve the quality of your data. Try to make one for yourself!

If you have any further query feel free to reach us at www.cloudanalogy.com and we will be happy to assist you.

Leave a Reply

Close Menu
Scroll Up