diff --git a/entity/Contact_entity/Contact_entity.aod b/entity/Contact_entity/Contact_entity.aod index 2cffc73dc956f7286abc98b0f5058e0e3a760835..2525ff9c3b4d5cc1b08803aed0223fd20e176212 100644 --- a/entity/Contact_entity/Contact_entity.aod +++ b/entity/Contact_entity/Contact_entity.aod @@ -18,6 +18,7 @@ <title>Organisation</title> <consumer>Organisations</consumer> <mandatory v="true" /> + <valueProcess>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/displayValueProcess.js</displayValueProcess> <onValidation>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/onValidation.js</onValidation> <onValueChange>%aditoprj%/entity/Contact_entity/entityfields/organisation_id/onValueChange.js</onValueChange> diff --git a/entity/Contact_entity/entityfields/organisation_id/valueProcess.js b/entity/Contact_entity/entityfields/organisation_id/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b25ed87f4581b8db000935c6eaa1bed89529079f --- /dev/null +++ b/entity/Contact_entity/entityfields/organisation_id/valueProcess.js @@ -0,0 +1,11 @@ +import("system.result"); +import("system.vars"); +import("system.neon"); + +if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && !vars.get("$this.value")) +{ + if(!vars.get("$field.ORGANISATION_ID")) + { + result.string("0"); + } +} \ No newline at end of file