Newer Version Available
Sample Account Address 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.
Canadian Billing Postal Code
| Field | Value |
|---|---|
| Description: | Validates that the account Billing Zip/Postal Code is in the correct format if Billing Country is Canada. |
| Formula: |
|
| Error Message: | Canadian postal code must be in A9A 9A9 format. |
| Error Location: | Billing Zip/Postal Code |
Billing Zip Code Is in Billing State
| Field | Value |
|---|---|
| Description: | Validates that the account Billing Zip/Postal Code is valid by looking up the first five characters of the value in a custom object called Zip_Code__c that contains a record for every valid zip code in the US. If the zip code is not found in the Zip_Code__c object, or the Billing State does not match the corresponding State_Code__c in the Zip_Code__c object, an error is displayed. |
| Formula: |
|
| Error Message: | Billing Zip Code does not exist in specified Billing State. |
| Error Location: | Billing Zip/Postal Code |
US Billing Zip Code
| Field | Value |
|---|---|
| Description: | Validates that the account Billing Zip/Postal Code is in 99999 or 99999-9999 format if Billing Country is USA or US. |
| Formula: |
|
| Error Message: | Zip code must be in 99999 or 99999-9999 format. |
| Error Location: | Billing Zip/Postal Code |
Shipping Zip Code
| Field | Value |
|---|---|
| Description: | Validates that the account Shipping Zip/Postal Code is in 99999 or 99999-9999 format if Shipping Country is USA or blank. |
| Formula: |
|
| Error Message: | Zip code must be in 99999 or 99999-9999 format. |
| Error Location: | Shipping Zip/Postal Code |
Valid Billing State (US)
Valid Billing Province (Canada)
| Field | Value |
|---|---|
| Description: | Validates that the account Billing State/Province is a valid two-character abbreviation if Billing Country is CA or CAN. |
| Formula: |
|
| Error Message: | A valid two-letter province code is required. |
| Error Location: | Billing State/Province |
Valid Shipping State
| Field | Value |
|---|---|
| Description: | Validates that the account Shipping State/Province is a valid two-character abbreviation if Shipping Country is US, USA, or blank. |
| Formula: |
|
| Error Message: | A valid two-letter state abbreviation is required. |
| Error Location: | Shipping State/Province |
Valid Shipping Province (Canada)
| Field | Value |
|---|---|
| Description: | Validates that the account Shipping State/Province is a valid two-character abbreviation, if Billing Country is CA or CAN. |
| Formula: |
|
| Error Message: | A valid two-letter province abbreviation is required. |
| Error Location: | Shipping State/Province |
Valid Billing Country
| Field | Value |
|---|---|
| Description: | Validates that the account Billing Country is a valid ISO 3166 two-letter code. |
| Formula: |
|
| Error Message: | A valid two-letter country code is required. |
| Error Location: | Billing Country |