Newer Version Available
Sample Contact Validation Rules
| Available in: both Salesforce Classic and Lightning Experience |
| 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.
Mailing Address Fields Are Required
| Field | Value |
|---|---|
| Description: | Validates that the contact Mailing Street, Mailing City, and Mailing Country are provided. |
| Formula: |
|
| Error Message: | Mailing Street, City, and Country are required. |
| Error Location: | Top of Page |
Mailing Street Is Required
| Field | Value |
|---|---|
| Description: | Validates that the contact Mailing Street is provided. |
| Formula: |
|
| Error Message: | Mailing Street is required. |
| Error Location: | Mailing Street |
Mailing Zip Code
| Field | Value |
|---|---|
| Description: | Validates that the contact Mailing Zip/Postal Code is in 99999 or 99999-9999 format if Mailing Country is USA or blank. |
| Formula: |
|
| Error Message: | Zip code must be in 99999 or 99999-9999 format. |
| Error Location: | Mailing Zip/Postal Code |
Phone Number Has International Format
| Field | Value |
|---|---|
| Description: | Validates that the Phone number begins with a plus sign (+) for country code. Note that this validation rule conflicts with the ten-digit rule. |
| Formula: |
|
| Error Message: | Phone number must begin with + (country code). |
| Error Location: | Phone |
US Phone Number Has Ten Digits
| Field | Value |
|---|---|
| Description: | Validates that the Phone number is in (999) 999-9999 format. This works by using the REGEX function to check that the number has ten digits in the (999) 999-9999 format. |
| Formula: |
|
| Error Message: | US phone numbers should be in this format: (999) 999-9999. |
| Error Location: | Phone |