Book Image

Salesforce Essentials for Administrators

By : Mohit Shrivatsava
Book Image

Salesforce Essentials for Administrators

By: Mohit Shrivatsava

Overview of this book

Table of Contents (14 chapters)
Salesforce Essentials for Administrators
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Validation rules


Validation is important to keep the records clean and avoid users from entering junk data. Salesforce provides the ability to validate data of each record that can be written in a formula to prevent users from entering wrong or unwanted data. Validation uses the formula we discussed to check for the error scenario. The error can be thrown at the global level (page level) and the field level.

The navigation path for the validation rule for a standard object is Setup | Customize | [Object Name] | Validation Rules. Alternatively, for newer orgs, we can also it find through Build | Accounts | Validation Rules. The navigation path for the validation rule for a custom object is Setup | Objects | Validation Rules.

Let's draft a validation rule now to restrict users to only enter numbers in the AccountNumber standard field (note that as it's a standard text field, we cannot change the data type to a number and avoid this rule).

So, the hint is to use the ISNUMBER function; let's see...