Newer Version Available

This content describes an older version of this product. View Latest

Sample Account Validation Rules

Available in: Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, Developer, and Database.com Editions

For more information on any of the formula functions used in these examples, see Formula Operators and Functions Overview.

Account Number Is Numeric

Field Value
Description: Validates that the Account Number is numeric if not blank.
Formula:
1AND(
2   ISBLANK(AccountNumber),
3   NOT(ISNUMBER(AccountNumber))
4)
Error Message: Account Number is not numeric.
Error Location: Account Number

Account Number Length

Field Value
Description: Validates that the Account Number is exactly seven digits (if it is not blank). The number seven is simply illustrative. You can change this to any number you like.
Formula:
1AND(
2   ISBLANK(AccountNumber),
3   LEN(AccountNumber) <> 7
4)
Error Message: Account Number must be seven digits.
Error Location: Account Number

Annual Revenue Range

Field Value
Description: Validates that the account Annual Revenue is not negative and does not exceed $100 billion. This limit is designed to catch typos.
Formula:
1OR(
2   AnnualRevenue < 0,
3   AnnualRevenue > 100000000000
4)
Error Message: Annual Revenue cannot exceed 100 billion.
Error Location: Annual Revenue