+ Start a Discussion
sfadm sfadmsfadm sfadm 

Billing Zip/Postal Code validation

I need a validation in the Biliing Post Code code field to prevent users from typing and entering City and Coutry into the Post Code field the way it is displayed in the followng image
User-added image
Please advise how such validation can be achieved?
Best Answer chosen by sfadm sfadm
James LoghryJames Loghry
Hi sfadm,

Take a look at this document which contains validation rules for postal codes: https://help.salesforce.com/articleView?id=fields_useful_validation_formulas_account_address.htm&type=5

Too long didn't read version: You can go as simple as checking the formatting of the postal code field, or as crazy as creating and validating against a custom setting that contains all the zip codes for US states and territories.

When you create the validation rule, you'll want to set the error message on the field level.  If you're unfamiliar with validation rules, be sure to check out the following Trailhead module: https://trailhead.salesforce.com/en/modules/point_click_business_logic/units/validation_rules

Cheer,
- James