Review examples of validation rules for various types of apps that you can use and
modify for your own purposes. Validation rules verify that the data a user enters in
a record meets the standards you specify before the user can save the record.
Required Editions
Available in: both Salesforce Classic and Lightning Experience
Available in: Contact Manager, Group, Professional,
Enterprise, Performance, Unlimited, Developer, and
Database.com Editions
User Permissions Needed
To view field validation rules:
View Setup and Configuration
To define or change field validation rules:
Customize Application
Use the following samples for validation rules in Salesforce and Salesforce AppExchange apps,
including:
Sample Account Validation Rules Validation rule examples for numeric account numbers, account number length, and annual revenue range.
Sample Call Center Validation Rules Validation rules for requiring a conditional description, preventing cases from being reset, restricting case status, and more.
Sample Date Validation Rules Examples for date validation rules. For example, how to validate that the value of a custom field is a weekday, a Saturday or Sunday, that a custom date field contains a date within the current month and year, and more.
Sample Number Validation Rules Examples for how to validate that users can't save a time card record with more than 40 hours in a work week, numbers can't be negative, and even or odd numbers.
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.