diff --git a/entity/Member_entity/recordcontainers/jdito/contentProcess.js b/entity/Member_entity/recordcontainers/jdito/contentProcess.js index 106d0d7c1fe86fe853657e79fc61e06935422f74..ae5e30a855fc0a3b811afcfadf5ada107c88e4c5 100644 --- a/entity/Member_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Member_entity/recordcontainers/jdito/contentProcess.js @@ -62,104 +62,4 @@ memberRows = memberRows.map(function(row) ]; }); -if (Utils.isNullOrEmpty(idValues) || memberRows.length === 0) -{ - if (vars.get("$param.ObjectType_param") == "Salesproject" && vars.get("$param.ObjectRowId_param") != null) - { - var orgContactId = newSelect("SALESPROJECT.CONTACT_ID") - .from("SALESPROJECT") - .where("SALESPROJECT.SALESPROJECTID", "$param.ObjectRowId_param") - .cell(); - - var districtLoadingConfig = entities.createConfigForLoadingRows() - .entity("DistrictResponsible_entity") - .provider("OrganisationResponsibles") - .addParameter("OrgUid_param", orgContactId) - .addParameter("OnlyActive_param", true) - .fields(["#UID","DISTRICTRESPONSIBLEID", "DISTRICT_ID", "EMPLOYEE_CONTACT_ID", - "EMPLOYEE_CONTACT_ID.displayValue", "USER_EDIT", "USER_NEW", - "departmentAttributeName", "DATE_EDIT", "DATE_NEW"]); - - var districtRows = entities.getRows(districtLoadingConfig); - - districtRows = districtRows.map(function(row) - { - return [ - row["#UID"], - row["DISTRICTRESPONSIBLEID"], - row["DISTRICT_ID"], - row["EMPLOYEE_CONTACT_ID"], - row["EMPLOYEE_CONTACT_ID.displayValue"], - row["USER_EDIT"], - row["USER_NEW"], - row["departmentAttributeName"], - row["DATE_EDIT"], - row["DATE_NEW"] - ]; - }); - } - - var responsibleUids = []; - - districtRows.forEach(function(row){ - responsibleUids.push(row[3]); - }); - - var loadingConfPers = entities.createConfigForLoadingRows() - .entity("Person_entity") - .uids(responsibleUids) - .fields(["ORGANISATION_ID", "ORGANISATION_NAME", "CONTACTROLE", "POSITION", - "FIRSTNAME", "LASTNAME", "SALUTATION", "TITLE", "PERSONID", "CONTACTID"]); - var persRowsMap = {}; - entities.getRows(loadingConfPers).forEach(function(item) { - persRowsMap[item["CONTACTID"]] = item; - }); - - var persRows = []; - responsibleUids.forEach(function(uid) { - persRows.push(persRowsMap[uid]); - }); - - persRows = persRows.map(function(row){ - return [row["SALUTATION"], row["TITLE"], row["FIRSTNAME"], row["LASTNAME"], - row["ORGANISATION_NAME"], row["ORGANISATION_ID"], row["CONTACTROLE"], - row["POSITION"], row["PERSONID"]]; - }); - - - districtRows.forEach(function(row, counter){ - - memberRows.push( - [row[0], - null, - row[3], - row[4], - persRows[counter][6], - row[7], - "VAADIN:GLOBE", - "TEXT:" + row[4].substring(row[4].indexOf(" ", 0)+1, row[4].length), - "70cbad1b-eac6-4369-ba50-4946e0fbcb3a", - translate.text("District Responsible"), - vars.get("$param.ObjectRowId_param"), - vars.get("$param.ObjectType_param"), - persRows[counter][5], - persRows[counter][4], - persRows[counter][2], - row[4], - persRows[counter][3], - persRows[counter][8], - persRows[counter][0], - persRows[counter][1], - persRows[counter][7], - null, - "DistrictResponsible", - "", - (new AttributeRelationQuery( - row[3], - $AttributeRegistry.loyalty() - ).includeDisplayValue().getSingleAttribute() || {displayValue: ""}).displayValue - ]); - }); -} - -result.object(memberRows); \ No newline at end of file +result.object(memberRows);