diff --git a/entity/AttributeRelation_entity/AttributeRelation_entity.aod b/entity/AttributeRelation_entity/AttributeRelation_entity.aod index 80addbafcc8b5d0a60f6e39ac6cfe1642f3ff7ff..d15eed456adbf95057975609e862dbb79e4df192 100644 --- a/entity/AttributeRelation_entity/AttributeRelation_entity.aod +++ b/entity/AttributeRelation_entity/AttributeRelation_entity.aod @@ -18,7 +18,7 @@ <title>Attribute</title> <mandatory v="true" /> <possibleItemsProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/possibleItemsProcess.js</possibleItemsProcess> - <stateProcess>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/stateProcess.js</stateProcess> + <onValueChange>%aditoprj%/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js</onValueChange> </entityField> <entityField> <name>OBJECT_ROWID</name> diff --git a/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..e641c892888d2ee12cdbf69f722f489e30af0f93 --- /dev/null +++ b/entity/AttributeRelation_entity/entityfields/ab_attribute_id/onValueChange.js @@ -0,0 +1,11 @@ +import("system.vars"); +import("system.neon"); + +if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || + vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) { + neon.setFieldValue("$field.BOOL_VALUE", null); + neon.setFieldValue("$field.CHAR_VALUE", null); + neon.setFieldValue("$field.DATE_VALUE", null); + neon.setFieldValue("$field.ID_VALUE", null); + neon.setFieldValue("$field.NUMBER_VALUE", null); +} \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js b/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js index 13b11be60e6ff9abcd2ae44306b70f3367cdb5ed..c5937313ed5351c005fd2f860e5df0cbd2f6cf5d 100644 --- a/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/bool_value/valueProcess.js @@ -1,3 +1,4 @@ +import("system.vars"); import("system.result"); - -result.string("0") \ No newline at end of file +if(!vars.get("$field.BOOL_VALUE")) + result.string("0"); \ No newline at end of file diff --git a/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js b/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js index 83fdc179510373157ac394d755c406adc59e1c43..5f2f5a7b0d369b3b45e91afe9248bfd1660c966a 100644 --- a/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js +++ b/entity/AttributeRelation_entity/entityfields/object_rowid/valueProcess.js @@ -2,5 +2,5 @@ import("system.vars"); import("system.result"); import("system.neon"); -if (vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.objectRowId_param") && vars.get("$param.objectRowId_param") != null) +if (vars.exists("$param.objectRowId_param") && vars.get("$param.objectRowId_param") != null) result.string(vars.get("$param.objectRowId_param")); \ No newline at end of file diff --git a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml index 260e47f10cced9f2d881daf4059c757b29dc8bed..6050c7975f3ca4e488aa25b19c31945a25df93e3 100644 --- a/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml +++ b/others/db_changes/data_alias/struct/AditoBasic/create_ab_attributerelation.xml @@ -18,9 +18,7 @@ <column name="ID_VALUE" type="CHAR(36)"/> <column name="DATE_VALUE" type="DATETIME"/> <column name="NUMBER_VALUE" type="NUMERIC(14,2)"/> - <column name="BOOL_VALUE" type="TINYINT"> - <constraints nullable="false"/> - </column> + <column name="BOOL_VALUE" type="TINYINT"/> </createTable> </changeSet> </databaseChangeLog> \ No newline at end of file