diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod index 3dbcf1f9873c47263c2a3dbe799bc62638f27e38..db95abf550f0eb6f8be509961236a026edce225b 100644 --- a/entity/Productprice_entity/Productprice_entity.aod +++ b/entity/Productprice_entity/Productprice_entity.aod @@ -64,6 +64,7 @@ <mandatory v="true" /> <stateProcess>%aditoprj%/entity/Productprice_entity/entityfields/product_id/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/Productprice_entity/entityfields/product_id/valueProcess.js</valueProcess> + <displayValueProcess>%aditoprj%/entity/Productprice_entity/entityfields/product_id/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>CONTACT_ID</name> diff --git a/entity/Productprice_entity/entityfields/product_id/displayValueProcess.js b/entity/Productprice_entity/entityfields/product_id/displayValueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..bee4e1ff594f5d36483d8c98ef8dcadc870dbea8 --- /dev/null +++ b/entity/Productprice_entity/entityfields/product_id/displayValueProcess.js @@ -0,0 +1,15 @@ +import("system.result"); +import("system.neon"); +import("system.vars"); +import("Sql_lib"); + + +// TODO: This should only be a temporary solution, till it's possible to also group fields of pageable dbRecordContainers that have their displayValue set via displayValueExpression (#1077182) +if((vars.exists("$param.ProductId_param") && vars.get("$param.ProductId_param") && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) + || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_EDIT || vars.get("$sys.recordstate") == neon.OPERATINGSTATE_VIEW) +{ + result.string(newSelect("PRODUCTNAME") + .from("PRODUCT") + .whereIfSet("PRODUCT.PRODUCTID", "$field.PRODUCT_ID") + .cell()); +} \ No newline at end of file diff --git a/entity/Productprice_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js b/entity/Productprice_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js index cbc5d9d359d33fe622b4e9052b1038a67111ffdb..c7a17f50a06cd9e8c445d0290d4b8d2c2b4d78bc 100644 --- a/entity/Productprice_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js +++ b/entity/Productprice_entity/recordcontainers/db/recordfieldmappings/product_id.displayvalue/expression.js @@ -1,4 +1 @@ -import("system.result"); - -result.string("select PRODUCTNAME from PRODUCT \n\ - where PRODUCT.PRODUCTID = PRODUCTPRICE.PRODUCT_ID"); \ No newline at end of file +// TODO: Fill this instead of the displayValueProcess once it's possible to also group fields of pageable dbRecordContainers that have their displayValue set via displayValueExpression (#1077182) \ No newline at end of file