Enforce Address Postcode Validation

LFS Version requirement: v11.16 or later

The delivery address form in Limio For Salesforce validates the Postal/Zip Code field value against a Regular Expression from the Custom Metadata Type config.

The validation occurs in the Delivery Contact component, in the Delivery Postal Code field, and depends on the Country being selected.

Screenshot_2022-09-02_at_10.10.22.png

Because the post code validation depends on the country being selected, any given post code is considered invalid as long as country field is not populated

Screenshot_2022-09-02_at_10.15.26.png

NOTE: if the setting is left blank and no regular expression is specified, any post code is considered as valid for the country.

The form supports further customisation for adding a custom validation message specific to each country. In this case the custom message will appear as placeholder to the delivery postal code, to help the user inputting the code in a valid format from the start.

mceclip0.png

If the format used is still invalid against the regex specified, the same validation message will appear as input field error message:

mceclip1.png

In order to update the regular expression and the corresponding validation message, follow the instructions below:

  1. In the Setup search box, look for the Custom Metadata Types and click 'Manage Records' on the Region type.

  2. Find a region of interest and click 'Edit'.

  3. Find the Address Validation field and populate a 'zip' property of the object inside with the relevant Regular Expression.

  4. In the same Address Validation filed, add (or edit) the property 'invalid_code_msg' with the relevant message.

  5. Save the record.

As an example, the Address Validation can be populated as follows for United Kingdom post codes.

Last updated

Was this helpful?