You need to sign in to do that
Don't have an account?
GeorgeTrommelen
validation rule on Dutch postal codes
Can anybody help me with avalidation rule for Dutch postal codes according the next format?
4 figures+one space+ 2 letters
eg.: 1234 AB
look forard to hear solutions.
George
Where DutchPostalCode__c is the field you are validating.
I'm not too good with regular expressions, but this seems to work as far as I can tell.
NOTE: I added the DutchPostalCode__c <> "" bit just in case the field is not required. Without this, the validation rule prevent the record from being saved if the value is empty. If the field is required through field level security, you can remove everything except for the NOT clause.
Message Edited by jpizzala on 06-02-2008 12:57 PM
Message Edited by jpizzala on 06-02-2008 12:59 PM
Do you want to make the postal code field required only when a certain country is selected? If so, you can accomplish this through a validation rule.
Or do you want the validation rule to be more robust and allow for a different validation for each postal code type, based on the Country field? For instance, if United States is chosen in the Country field the Postal Code field would validate for a United States postal code format and if Japan was chosen in the Country field the Postal Code field would validate for a Japanese postal code, etc? To accomplish this, you could expand on the validation rule for the Postal Code field. Just add some logic that will execute upon the value of the Country field via CASE and ISPICKVAL formula functions.
This could get a bit messy, however, depending on how many countries you want to validate. If it gets too large, I would suggest creating an Apex class to process the validation instead of the standard formula-driven validation rule approach.
Message Edited by jpizzala on 07-09-2008 02:53 PM