Validating if US zip codes are well formed using a validation rule with REGEX
Accurate information and reports are vital in an effective Salesforce CRM system and without it, users and sales management cannot make informed decisions. One way to achieve accurate information for reporting is by ensuring that data is stored in a consistent manner.
In this recipe, we will create a validation rule to ensure that US zip codes conform to the correct format.
How to do it...
Carry out the following step to create a validation rule:
Navigate to the account customization setup page, by going to Your Name | Setup | Customize | Accounts | Validation Rules.
Click on New.
Note
Here, we are presented with the Account Validation Rule Edit page.
Type
Valid US Zip Code
in the Field Label textbox (upon clicking out of the textbox, the name changes to Valid_US_Zip_Code).Leave the Active checkbox checked.
Optionally, set the Description field to
This validation rule is for ensuring the entry of valid US Zip codes
.Note...