diff --git a/entity/Order_entity/Order_entity.aod b/entity/Order_entity/Order_entity.aod index d79ba832ff8a9ec266e21b15c121ce61850a8be6..1e7177a4be09905ec0d36658d440a770f2721182 100644 --- a/entity/Order_entity/Order_entity.aod +++ b/entity/Order_entity/Order_entity.aod @@ -57,6 +57,7 @@ <linkedContextProcess>%aditoprj%/entity/Order_entity/entityfields/relation_id/linkedContextProcess.js</linkedContextProcess> <mandatory v="true" /> <outgoingField>OrderRelation_dfo</outgoingField> + <displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/relation_id/displayValueProcess.js</displayValueProcess> <onValueChange>%aditoprj%/entity/Order_entity/entityfields/relation_id/onValueChange.js</onValueChange> <onValueChangeTypes> <element>MASK</element> @@ -65,10 +66,11 @@ <entityField> <name>SALESPROJECT_ID</name> <title>Salesproject</title> + <linkedContext>Salesproject_context</linkedContext> <mandatory v="true" /> <state>INVISIBLE</state> <stateProcess>%aditoprj%/entity/Order_entity/entityfields/salesproject_id/stateProcess.js</stateProcess> - <valueProcess></valueProcess> + <displayValueProcess>%aditoprj%/entity/Order_entity/entityfields/salesproject_id/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>STATUS</name> @@ -301,19 +303,33 @@ <onDBDelete>%aditoprj%/entity/Order_entity/recordcontainers/db/onDBDelete.js</onDBDelete> <linkInformation> <linkInformation> - <name>ab8d856d-4776-4373-b675-37a1a672a7a6</name> + <name>f84d86a8-867d-44ea-bce5-3489bbee55a0</name> <tableName>SALESORDER</tableName> <primaryKey>SALESORDERID</primaryKey> <isUIDTable v="true" /> <readonly v="false" /> </linkInformation> <linkInformation> - <name>0580b93e-94bf-4a52-a4c0-3746733e559c</name> + <name>2c489a72-00ee-4bad-929f-25ef82dbc714</name> <tableName>RELATION</tableName> <primaryKey>RELATIONID</primaryKey> <isUIDTable v="false" /> <readonly v="true" /> </linkInformation> + <linkInformation> + <name>3888fb8c-6d2a-42e6-8abd-e4a9ac7a74ac</name> + <tableName>ORG</tableName> + <primaryKey>ORGID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> + <linkInformation> + <name>75470798-2097-41a2-95c2-22cf80d2f0c4</name> + <tableName>PERS</tableName> + <primaryKey>PERSID</primaryKey> + <isUIDTable v="false" /> + <readonly v="true" /> + </linkInformation> </linkInformation> <recordFieldMappings> <dbRecordFieldMapping> @@ -384,10 +400,6 @@ <name>RELATION_ID.value</name> <recordfield>SALESORDER.RELATION_ID</recordfield> </dbRecordFieldMapping> - <dbRecordFieldMapping> - <name>RELATION_ID.displayValue</name> - <recordfield>RELATION.RELATIONID</recordfield> - </dbRecordFieldMapping> <dbRecordFieldMapping> <name>RELATION_ORG_ID.value</name> <recordfield>RELATION.ORG_ID</recordfield> diff --git a/entity/Order_entity/entityfields/relation_id/displayValueProcess.js b/entity/Order_entity/entityfields/relation_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..5159f2ac23951196460df8dea03ebbd65be479f8 --- /dev/null +++ b/entity/Order_entity/entityfields/relation_id/displayValueProcess.js @@ -0,0 +1,6 @@ +import("system.result"); +import("system.vars"); +import("Relation_lib"); +import("system.neon"); + +result.string(RelationUtils.getNameByPersOrgWithRelationId(vars.getString("$field.RELATION_ID"))); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/relation_id/linkedContextProcess.js b/entity/Order_entity/entityfields/relation_id/linkedContextProcess.js index 3a6e4491a59e5e669d633fd2118241feb860dc59..2c8672f45309b0e7948787e30a5e7da698a515e0 100644 --- a/entity/Order_entity/entityfields/relation_id/linkedContextProcess.js +++ b/entity/Order_entity/entityfields/relation_id/linkedContextProcess.js @@ -1,18 +1,5 @@ -import("system.result"); import("system.vars"); -import("Relation_lib") +import("system.result"); +import("Relation_lib"); -if(!vars.get("$field.RELATION_PERS_ID") && !vars.get("$field.RELATION_ORG_ID")) - result.string(""); -else { - switch (RelationUtils.getRelationTypeByPersOrg(vars.get("$field.RELATION_PERS_ID"), vars.get("$field.RELATION_ORG_ID"))) - { - case 1: // Org - result.string("Org_context") - break; - case 2: // private Pers - case 3: // Pers - result.string("Pers_context") - default: - } -} \ No newline at end of file +result.string(RelationUtils.getContextByRelationId(vars.getString("$field.RELATION_ID"))); \ No newline at end of file diff --git a/entity/Order_entity/entityfields/salesproject_id/displayValueProcess.js b/entity/Order_entity/entityfields/salesproject_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..65afbf6e950eebef0268138074bc97f00869eb0a --- /dev/null +++ b/entity/Order_entity/entityfields/salesproject_id/displayValueProcess.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); +import("Salesproject_lib"); + +result.string(Salesproject.getSalesProjectTitleById(vars.getString("$field.SALESPROJECT_ID"))); \ No newline at end of file