diff --git a/entity/Organisation_entity/Organisation_entity.aod b/entity/Organisation_entity/Organisation_entity.aod index 2ceff6d01446144e2dc10af70fa4fce94795b4e8..645167af39422a122c9a3174a332593168dbf077 100644 --- a/entity/Organisation_entity/Organisation_entity.aod +++ b/entity/Organisation_entity/Organisation_entity.aod @@ -1323,7 +1323,7 @@ <children> <entityParameter> <name>ContactIds_param</name> - <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnovers/children/contactid_param/valueProcess.js</valueProcess> + <valueProcess>%aditoprj%/entity/Organisation_entity/entityfields/turnovers/children/contactids_param/valueProcess.js</valueProcess> </entityParameter> </children> </entityConsumer> diff --git a/entity/Organisation_entity/entityfields/turnovers/children/contactid_param/valueProcess.js b/entity/Organisation_entity/entityfields/turnovers/children/contactid_param/valueProcess.js deleted file mode 100644 index 7b6137b4d105e9ba592cf8ef6e796fb838a32b09..0000000000000000000000000000000000000000 --- a/entity/Organisation_entity/entityfields/turnovers/children/contactid_param/valueProcess.js +++ /dev/null @@ -1,4 +0,0 @@ -import("system.vars"); -import("system.result"); - -result.string(vars.get("$field.CONTACTID")); \ No newline at end of file diff --git a/entity/Organisation_entity/entityfields/turnovers/children/contactids_param/valueProcess.js b/entity/Organisation_entity/entityfields/turnovers/children/contactids_param/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..3fc1cfa96d62ec1ae9c92d18ba1eda045ec48135 --- /dev/null +++ b/entity/Organisation_entity/entityfields/turnovers/children/contactids_param/valueProcess.js @@ -0,0 +1,4 @@ +import("system.vars"); +import("system.result"); + +result.string(JSON.stringify([vars.get("$field.CONTACTID")])); \ No newline at end of file diff --git a/entity/Turnover_entity/initFilterProcess.js b/entity/Turnover_entity/initFilterProcess.js index 3d13a60e2f3916f127dac1fef6e346099e275eec..b5555d1a971b7f5c77d5b77dc789c10f95427380 100644 --- a/entity/Turnover_entity/initFilterProcess.js +++ b/entity/Turnover_entity/initFilterProcess.js @@ -6,8 +6,8 @@ import("Keyword_lib"); import("KeywordRegistry_basic"); import("system.result"); -var contactIds = vars.get("$param.ContactIds_param"); -var salesprojectId = vars.get("$param.SalesprojectIdDynamicChart_param"); +var contactIds = vars.exists("$param.ContactIds_param") ? vars.get("$param.ContactIds_param") : false; +var salesprojectId = vars.exists("$param.SalesprojectIdDynamicChart_param") ? vars.get("$param.SalesprojectIdDynamicChart_param") : false; if(contactIds || salesprojectId) { diff --git a/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js index 4587f5ee9896b427e5cbcadd0bac01c665ced53c..4b33154216789153d8770778403321428b06b6b1 100644 --- a/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js +++ b/process/TransferSalesprojectPhaseDefinitionToChecklist_serverProcess/process.js @@ -10,6 +10,8 @@ var cols = ["TITLE", "DESCRIPTION", "COND", "CONTEXT", "AUTOPROBABILITY"]; salesprojectPhaseDefs.forEach(function([checklistId, phase, description, autoprobability]){ let filterCond = "{\"entity\":\"Salesproject_entity\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[{\"type\":\"row\",\"name\":\"PHASE\",\"operator\":\"EQUAL\",\"value\":\"" + KeywordUtils.getViewValue($KeywordRegistry.salesprojectPhase(), phase) + "\",\"key\":\"" + phase + "\",\"contenttype\":\"TEXT\"}]}}"; + description = description || translate.text("Checklist"); //avoid null values + let vals = [description, description, filterCond, "Salesproject", autoprobability]; let cond = newWhere("CHECKLIST.CHECKLISTID", checklistId).toString(); updates.push([table, cols, null, vals, cond]);