diff --git a/entity/Activity_entity/recordcontainers/db/conditionProcess.js b/entity/Activity_entity/recordcontainers/db/conditionProcess.js index 950fcd1f1dc1877ea33c1de0d3c20e92fd9e654a..c89f50125db5c7f010e527b361610cde83d867c9 100644 --- a/entity/Activity_entity/recordcontainers/db/conditionProcess.js +++ b/entity/Activity_entity/recordcontainers/db/conditionProcess.js @@ -14,28 +14,9 @@ if (vars.exists("$param.RowId_param") && vars.get("$param.RowId_param") && vars. .and("ACTIVITYLINK.OBJECT_TYPE", "$param.ObjectId_param"); var rowId = vars.get("$param.RowId_param"); - if (vars.get("$param.ObjectId_param") == "Person") - { - //in the Person context, all activities linked to the person should be shown, so it is necessary to get all contactIds of that person - var allPersonRelatedContactIds = newSelect("personContacts.CONTACTID") - .from("CONTACT") - .join("CONTACT", "CONTACT.PERSON_ID = personContacts.PERSON_ID", "personContacts") - .where("CONTACT.CONTACTID", "$param.RowId_param") - .arrayColumn(); - - if (allPersonRelatedContactIds.length === 0) - condition.noResult(); - else - { - activityLinkSubselect.and("ACTIVITYLINK.OBJECT_ROWID", allPersonRelatedContactIds, SqlBuilder.IN()); - condition.and(null, activityLinkSubselect, SqlBuilder.EXISTS()); - } - } - else - { - activityLinkSubselect.and("ACTIVITYLINK.OBJECT_ROWID", "$param.RowId_param"); - condition.and(null, activityLinkSubselect, SqlBuilder.EXISTS()); - } + + activityLinkSubselect.and("ACTIVITYLINK.OBJECT_ROWID", "$param.RowId_param"); + condition.and(null, activityLinkSubselect, SqlBuilder.EXISTS()); } if (vars.exists("$param.ActivityIDs_param") && vars.get("$param.ActivityIDs_param"))