Validation on ZIP Code Pattern #inSalesforce

Validation on ZIP code :


Zip code must be in 99999 or 99999-9999 format


Use: 

AND(
OR(MailingCountry = "USA", MailingCountry = "US"),
NOT(REGEX( MailingPostalCode , "\\d{5}(-\\d{4})?"))
)


Error Message: Zip code must be in 99999 or 99999-9999 format.


Comments