diff --git a/entity/Address_entity/Address_entity.aod b/entity/Address_entity/Address_entity.aod index 35ab6ef67ca21388a5710d2f9020c3d6f096dcd6..b7ca56c292287f17f764e8b3df0ab436aa83b7c6 100644 --- a/entity/Address_entity/Address_entity.aod +++ b/entity/Address_entity/Address_entity.aod @@ -76,6 +76,7 @@ <title>postcode</title> <consumer>ZipValidation</consumer> <mandatoryProcess>%aditoprj%/entity/Address_entity/entityfields/zip/mandatoryProcess.js</mandatoryProcess> + <newItemsAllowed v="true" /> <displayValueProcess>%aditoprj%/entity/Address_entity/entityfields/zip/displayValueProcess.js</displayValueProcess> <onValidation>%aditoprj%/entity/Address_entity/entityfields/zip/onValidation.js</onValidation> <onValueChange>%aditoprj%/entity/Address_entity/entityfields/zip/onValueChange.js</onValueChange> diff --git a/process/WsValidation_lib/process.js b/process/WsValidation_lib/process.js index 4cc2f2effeba10f8275ec5e86f604911df2eb994..c33dc9b3c4dc57eee761acebcd8d551246729bed 100644 --- a/process/WsValidation_lib/process.js +++ b/process/WsValidation_lib/process.js @@ -66,7 +66,7 @@ WsValidationType.get = function(pKey) data.region, data.state, data[this.paramName]] - }) + }, this) } function _processCommunicationValidation(pWsResult, pValue) @@ -147,8 +147,14 @@ WsValidationUtils.validate = function(pValue, pType, pCountry) */ WsValidationUtils.setAddressFields = function() { - var data = JSON.parse(vars.get("$this.value")); - + try + { + var data = JSON.parse(vars.get("$this.value")); + } catch (exception) { + // if no valid json + return + } + _setField("$field.ZIP", data.zip); _setField("$field.COUNTRY", data.country); _setField("$field.CITY", data.city);