diff --git a/entity/Employee_entity/Employee_entity.aod b/entity/Employee_entity/Employee_entity.aod index 60ea8401f68c771715b123bb20d125584e78a98f..c3144f1349c9b1618e1f5d48999a1152564db3a8 100644 --- a/entity/Employee_entity/Employee_entity.aod +++ b/entity/Employee_entity/Employee_entity.aod @@ -64,6 +64,7 @@ <mandatory v="true" /> <dropDownProcess>%aditoprj%/entity/Employee_entity/entityfields/email_address/dropDownProcess.js</dropDownProcess> <textInputAllowed v="true" /> + <stateProcess>%aditoprj%/entity/Employee_entity/entityfields/email_address/stateProcess.js</stateProcess> <onValidation>%aditoprj%/entity/Employee_entity/entityfields/email_address/onValidation.js</onValidation> </entityField> <entityField> diff --git a/entity/Employee_entity/entityfields/email_address/stateProcess.js b/entity/Employee_entity/entityfields/email_address/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..41639552eca72ca53a61a9edc3d2e68166f71448 --- /dev/null +++ b/entity/Employee_entity/entityfields/email_address/stateProcess.js @@ -0,0 +1,9 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); + +//the email should not be changed afterwards, because it is also used as calendar id +if (!vars.get("$field.EMAIL_ADDRESS") || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + result.string(neon.COMPONENTSTATE_EDITABLE); +else + result.string(neon.COMPONENTSTATE_READONLY);