diff --git a/entity/Orderitem_entity/Orderitem_entity.aod b/entity/Orderitem_entity/Orderitem_entity.aod index ae3ec522497d3f7e869e6391c700af597405db11..14b2e4111b7f0fd824d2ee2cdcdb08cd553f298f 100644 --- a/entity/Orderitem_entity/Orderitem_entity.aod +++ b/entity/Orderitem_entity/Orderitem_entity.aod @@ -62,7 +62,8 @@ <name>PRODUCT_ID</name> <documentation>%aditoprj%/entity/Orderitem_entity/entityfields/product_id/documentation.adoc</documentation> <title>Article</title> - <possibleItemsProcess>%aditoprj%/entity/Orderitem_entity/entityfields/product_id/possibleItemsProcess.js</possibleItemsProcess> + <consumer>Products</consumer> + <linkedContext>Product_context</linkedContext> <onValueChange>%aditoprj%/entity/Orderitem_entity/entityfields/product_id/onValueChange.js</onValueChange> <onValueChangeTypes> <element>MASK</element> @@ -182,6 +183,15 @@ </entityParameter> </children> </entityConsumer> + <entityConsumer> + <name>Products</name> + <fieldType>DEPENDENCY_OUT</fieldType> + <dependency> + <name>dependency</name> + <entityName>Product_entity</entityName> + <fieldName>#PROVIDER</fieldName> + </dependency> + </entityConsumer> </entityFields> <recordContainers> <dbRecordContainer> @@ -271,6 +281,10 @@ <name>UNIT.displayValue</name> <expression>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/unit.displayvalue/expression.js</expression> </dbRecordFieldMapping> + <dbRecordFieldMapping> + <name>PRODUCT_ID.displayValue</name> + <expression>%aditoprj%/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js</expression> + </dbRecordFieldMapping> </recordFieldMappings> </dbRecordContainer> </recordContainers> diff --git a/entity/Orderitem_entity/entityfields/product_id/possibleItemsProcess.js b/entity/Orderitem_entity/entityfields/product_id/possibleItemsProcess.js deleted file mode 100644 index e19938f82d7f21dbf4c8d427e08312291222547b..0000000000000000000000000000000000000000 --- a/entity/Orderitem_entity/entityfields/product_id/possibleItemsProcess.js +++ /dev/null @@ -1,16 +0,0 @@ -import("system.result"); -import("system.db"); -import("Sql_lib"); - -//TODO: change field to lookup field -var sqlUtils = new SqlMaskingUtils(); -var prodsSql = "select PRODUCTID, " + sqlUtils.concat(["PRODUCTCODE", "PRODUCTNAME"], "/") - + " from PRODUCT"; - -var prods = db.table(prodsSql); - -var retArray = []; -for(var i = 0; i < prods.length; i++) - retArray.push(prods[i]); - -result.object(retArray); \ No newline at end of file diff --git a/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js new file mode 100644 index 0000000000000000000000000000000000000000..c356272a55066e5913df7b5cbaa668d875d88983 --- /dev/null +++ b/entity/Orderitem_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js @@ -0,0 +1,5 @@ +import("system.vars"); +import("system.result"); + +// TODO: remove when #title is used as display value for lookups +result.string("(select PRODUCT.PRODUCTNAME from PRODUCT where SALESORDERITEM.PRODUCT_ID = PRODUCT.PRODUCTID)"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/image/onValueChange.js b/entity/Person_entity/entityfields/image/onValueChange.js index f7fffb124f892cacb684ac531a608d61bae0ad4e..86a4f85653ae6eb9a622f17318dd0e4782e75ee3 100644 --- a/entity/Person_entity/entityfields/image/onValueChange.js +++ b/entity/Person_entity/entityfields/image/onValueChange.js @@ -1,4 +1,4 @@ import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.IMAGE"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/standard_email_comm/onValueChange.js b/entity/Person_entity/entityfields/standard_email_comm/onValueChange.js index 25c5a67ac861d7df3fec7904a7c03cc2259d533f..972cb181d553b480c039c0d77fca8da35a528c71 100644 --- a/entity/Person_entity/entityfields/standard_email_comm/onValueChange.js +++ b/entity/Person_entity/entityfields/standard_email_comm/onValueChange.js @@ -1,4 +1,4 @@ import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.STANDARD_EMAIL_COMMUNICATION"); \ No newline at end of file diff --git a/entity/Person_entity/entityfields/standard_phone_comm/onValueChange.js b/entity/Person_entity/entityfields/standard_phone_comm/onValueChange.js index fd9905c4cde0fbf215614f72b3ba3a72fc5221a6..991c92d38d0731524a8de4eb6d0adabb661a71c3 100644 --- a/entity/Person_entity/entityfields/standard_phone_comm/onValueChange.js +++ b/entity/Person_entity/entityfields/standard_phone_comm/onValueChange.js @@ -1,4 +1,4 @@ import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.STANDARD_PHONE_COMMUNICATION"); \ No newline at end of file diff --git a/entity/Person_entity/recordcontainers/db/onDBUpdate.js b/entity/Person_entity/recordcontainers/db/onDBUpdate.js index ebda79e51184b78501f01b875ed379b6e70069fb..c1aaada5945950cf44c87edc3e7688fba2a518ad 100644 --- a/entity/Person_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Person_entity/recordcontainers/db/onDBUpdate.js @@ -3,7 +3,7 @@ import("Person_lib"); import("Communication_lib"); import("Entity_lib"); -// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer +// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023 FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function(state, value){ if (state == FieldChanges.STATE_CHANGED()) PersUtils.setImage(vars.get("$field.PERSONID"), value); diff --git a/entity/Product_entity/Product_entity.aod b/entity/Product_entity/Product_entity.aod index 678e3886fa78d3bb92ebad1c307a21831b8ce061..2cd464e46c26353a7790d6bbf77fc1bb5679c6fe 100644 --- a/entity/Product_entity/Product_entity.aod +++ b/entity/Product_entity/Product_entity.aod @@ -153,6 +153,12 @@ <fieldName>Products</fieldName> <isConsumer v="false" /> </entityDependency> + <entityDependency> + <name>e4ba4c26-a777-4560-ab68-311ffae76e2f</name> + <entityName>Orderitem_entity</entityName> + <fieldName>Products</fieldName> + <isConsumer v="false" /> + </entityDependency> </dependencies> </entityProvider> <entityConsumer> diff --git a/entity/Product_entity/entityfields/image/onValueChange.js b/entity/Product_entity/entityfields/image/onValueChange.js index 4997061690d757b4a7e50c905c0331a6f8897d40..1fc5daeeea2101848906d4ec2c0f78ebc23fd634 100644 --- a/entity/Product_entity/entityfields/image/onValueChange.js +++ b/entity/Product_entity/entityfields/image/onValueChange.js @@ -1,5 +1,5 @@ import("system.vars"); import("Entity_lib"); -// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process +// TODO: also there is currently no good way to do updates with fields not connected to the record container. Workaround: imagevariable and update in onDBUpdate Process #1030023 FieldChanges.setChange("$field.IMAGE"); \ No newline at end of file diff --git a/entity/Product_entity/recordcontainers/db/onDBUpdate.js b/entity/Product_entity/recordcontainers/db/onDBUpdate.js index de4985229e60c54dd9a0d801d432350214f14eb7..11c4f6b2dd52dd21b4935cdf8f9bb011d9cbc4c6 100644 --- a/entity/Product_entity/recordcontainers/db/onDBUpdate.js +++ b/entity/Product_entity/recordcontainers/db/onDBUpdate.js @@ -2,7 +2,7 @@ import("system.vars"); import("Product_lib"); import("Entity_lib"); -// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer +// TODO: this is a workaround for missing possibility to react on changes of fields not connected to record Contqainer #1030023 FieldChanges.assimilateChangeAndDispose("$field.IMAGE", function(state, value){ if (state == FieldChanges.STATE_CHANGED()) ProductUtils.setImage(vars.get("$field.PRODUCTID"), value); diff --git a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod index 5edf76c7779d54bddc411de7cb54029b31b8bf2f..336d6b092bda8ab38166821c8d50c82ace586ceb 100644 --- a/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod +++ b/preferences/_____PREFERENCES_PROJECT/_____PREFERENCES_PROJECT.aod @@ -2,7 +2,7 @@ <preferences xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="3.0.3" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/preferences/3.0.3"> <name>_____PREFERENCES_PROJECT</name> <majorModelMode>DISTRIBUTED</majorModelMode> - <projectName>xRM-Basic5</projectName> + <projectName>xRM-Basic2019</projectName> <jditoMaxContentSize v="57671680" /> <calendarCategoriesEvent> <entry>