diff --git a/entity/Organisation_entity/recordcontainers/index/query.js b/entity/Organisation_entity/recordcontainers/index/query.js index 0bc707c216716ac660c5975697b5747f6622bd42..2d434dc250ffc55f3a17d7dfc6994f29dc86f083 100644 --- a/entity/Organisation_entity/recordcontainers/index/query.js +++ b/entity/Organisation_entity/recordcontainers/index/query.js @@ -1,3 +1,4 @@ +import("Organisation_lib"); import("KeywordRegistry_basic"); import("system.translate"); import("system.result"); @@ -57,9 +58,9 @@ var querySelect = newSelect([ .and(["COMMUNICATION", "MEDIUM_ID", "standardPhone"], commMediumPhoneIds, SqlBuilder.IN()) .and(["COMMUNICATION", "ISSTANDARD", "standardPhone"], "1") , "standardPhone") - .where("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL()); + .where("CONTACT.STATUS", $KeywordRegistry.contactStatus$inactive(), SqlBuilder.NOT_EQUAL()) + .and("ORGANISATION.ORGANISATIONID", OrgUtils.getPrivateOrganisationId(), SqlBuilder.NOT_EQUAL()); if (vars.exists("$local.idvalue") && vars.get("$local.idvalue") && vars.get("$local.idvalue").length > 0) querySelect.and("CONTACT.CONTACTID", "$local.idvalue"); - result.string(querySelect.toString());