diff --git a/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js b/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js index 6b012d3a311f754687e1b770982f45bc8a6f4b4e..f8c7455fe2093d91e16c3e5457bd631a17d7e509 100644 --- a/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js +++ b/entity/ObjectRelation_entity/recordcontainers/db/conditionProcess.js @@ -4,14 +4,6 @@ import("system.result"); import("system.db"); import("Sql_lib"); -logging.log("rowid: " + vars.get("$param.Object1Rowid_param")) -logging.log("type: " + vars.get("$param.Object1Type_param")) -logging.log(SqlCondition.begin() - .andPrepareVars("AB_OBJECTRELATION.OBJECT1_TYPE", "$param.Object1Type_param") - .andPrepareVars("AB_OBJECTRELATION.OBJECT1_ROWID", "$param.Object1Rowid_param") - .andPrepareVars("AB_OBJECTRELATION.AB_OBJECTRELATIONID", "$param.ObjectRelatonId_param") - .build("1=2").toSource()) - result.string(db.translateCondition(SqlCondition.begin() .andPrepareVars("AB_OBJECTRELATION.OBJECT1_TYPE", "$param.Object1Type_param") .andPrepareVars("AB_OBJECTRELATION.OBJECT1_ROWID", "$param.Object1Rowid_param") diff --git a/entity/Productprice_entity/Productprice_entity.aod b/entity/Productprice_entity/Productprice_entity.aod index c767d4f5e28491389e17b0827795b540631265f2..e15116e40b8c41eb3e78639a5d22522f622889e2 100644 --- a/entity/Productprice_entity/Productprice_entity.aod +++ b/entity/Productprice_entity/Productprice_entity.aod @@ -4,7 +4,6 @@ <title>Price list</title> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/Productprice_entity/documentation.adoc</documentation> - <onValidation>%aditoprj%/entity/Productprice_entity/onValidation.js</onValidation> <recordContainer>db</recordContainer> <entityFields> <entityField> @@ -56,10 +55,11 @@ <name>PRODUCT_ID</name> <title>Product</title> <linkedContext>Product_context</linkedContext> - <mandatory v="false" /> + <mandatory v="true" /> <outgoingField>ProductpriceProduct_dfo</outgoingField> <state>AUTO</state> <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>RELATION_ID</name> @@ -134,11 +134,6 @@ <mandatory v="false" /> <description>PARAMETER</description> </entityParameter> - <entityField> - <name>PRODUCT_GROUPCODEID</name> - <title>Product group</title> - <possibleItemsProcess>%aditoprj%/entity/Productprice_entity/entityfields/product_groupcodeid/possibleItemsProcess.js</possibleItemsProcess> - </entityField> <entityIncomingField> <name>OrgProductprice_dfi</name> <fieldType>DEPENDENCY_IN</fieldType> @@ -194,13 +189,11 @@ <dbRecordContainer> <name>db</name> <alias>Data_alias</alias> - <maximumDbRows v="0" /> <conditionProcess>%aditoprj%/entity/Productprice_entity/recordcontainers/db/conditionProcess.js</conditionProcess> <orderClauseProcess>%aditoprj%/entity/Productprice_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess> - <onDBInsert>%aditoprj%/entity/Productprice_entity/onDBInsert.js</onDBInsert> <linkInformation> <linkInformation> - <name>b65e4aab-35f4-49d0-8f05-389572f29dcb</name> + <name>85fd1bcf-499f-4708-ad8e-18f5a0f5337d</name> <tableName>PRODUCTPRICE</tableName> <primaryKey>PRODUCTPRICEID</primaryKey> <isUIDTable v="true" /> diff --git a/entity/Productprice_entity/entityfields/product_groupcodeid/possibleItemsProcess.js b/entity/Productprice_entity/entityfields/product_groupcodeid/possibleItemsProcess.js deleted file mode 100644 index 8828ea38229e76281d5bca8673172307d373418f..0000000000000000000000000000000000000000 --- a/entity/Productprice_entity/entityfields/product_groupcodeid/possibleItemsProcess.js +++ /dev/null @@ -1,7 +0,0 @@ -import("system.result"); -import("Keyword_lib"); - -var items; - -items = KeywordUtils.getStandardArray("GROUPCODE"); -result.object(items); \ No newline at end of file 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..43c39903a23d8351d40700d8c951da800bf5381b --- /dev/null +++ b/entity/Productprice_entity/entityfields/product_id/displayValueProcess.js @@ -0,0 +1,8 @@ +import("system.result"); +import("system.db"); +import("Sql_lib"); + +// TODO: Wenn es möglich ist, den anzeigenamen des Produkts über die Entity beziehung zu laden, dann umbauen...!!! +result.string(db.cell(SqlCondition.begin() + .andPrepareVars("PRODUCT.PRODUCTID", "$field.PRODUCT_ID") + .buildSql("select PRODUCTNAME from PRODUCT", "1=2"))); \ No newline at end of file diff --git a/entity/Productprice_entity/entityfields/product_id/valueProcess.js b/entity/Productprice_entity/entityfields/product_id/valueProcess.js index c54ef701cedc01a2fa09b44824bbb22ee9f6a3d7..fa4b37b7f62ac66212ae7e657d345dc4ea98ee7c 100644 --- a/entity/Productprice_entity/entityfields/product_id/valueProcess.js +++ b/entity/Productprice_entity/entityfields/product_id/valueProcess.js @@ -1,10 +1,9 @@ +import("system.logging"); import("system.result"); -import("system.neon"); import("system.vars"); -if(vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW) +if(vars.exists("$param.ProductId_param") && vars.get("$param.ProductId_param")) { - if(vars.exists("$param.ProductId_param") && vars.get("$param.ProductId_param") != null && vars.get("$param.ProductId_param") != "") - result.string(vars.getString("$param.ProductId_param")); -} - + result.string(vars.getString("$param.ProductId_param")); + logging.log("---" + vars.get("$param.ProductId_param")) +} \ No newline at end of file diff --git a/process/Product_lib/process.js b/process/Product_lib/process.js index ceb0f67234b9a2845221bdad226208dd912432f3..f0216b63a315ed22f988b694581a47b504121be1 100644 --- a/process/Product_lib/process.js +++ b/process/Product_lib/process.js @@ -48,7 +48,7 @@ ProductUtils.getCurrentProductPrice = function(pid, buySell) { else return ""; } else { - throw new Error(); // TODO: add message + return ""; } }