diff --git a/process/StandardObject_lib/process.js b/process/StandardObject_lib/process.js index fbc566801e827f744dd95518c2fa1d25e495ba84..106239747a73b333da72badc12d61d21560b253e 100644 --- a/process/StandardObject_lib/process.js +++ b/process/StandardObject_lib/process.js @@ -5,6 +5,7 @@ import("Keyword_lib"); import("KeywordRegistry_basic"); import("Contact_lib"); import("Communication_lib"); +import("Context_lib"); function StandardObject (pObjectType, pObjectID, pScopeType, pScopeID) { if (!this._isValidType("object", pObjectType)) @@ -246,7 +247,7 @@ StandardObject.prototype._getCompanyStandardAddress = function (pOrganisationID) * * @param {String} pObjectRowId The rowid of the communication to check. * @param {String} pMediumCategory Medium category to check. - * @param {String} pObjectType=Contact (Optional) The type of the rowid + * @param {String} pObjectType=CurrentContextId (Optional) The type of the rowid * @return {Boolean} If the contact already has a standard addres with the given * medium category. */ @@ -258,7 +259,7 @@ StandardObject.prototype._hasStandardCommunicationByMedium = function (pObjectRo .leftJoin("AB_KEYWORD_ATTRIBUTERELATION", "AB_KEYWORD_ENTRY_ID = AB_KEYWORD_ENTRYID") .where("ISSTANDARD = 1") .and("COMMUNICATION.OBJECT_ROWID", pObjectRowId) - .and("COMMUNICATION.OBJECT_TYPE", (pObjectType ? pObjectType : CommUtil.defaultObjectType())) + .and("COMMUNICATION.OBJECT_TYPE", (pObjectType ? pObjectType : ContextUtils.getCurrentContextId())) .and("AB_KEYWORD_ENTRY.KEYID", CommUtil.getMediumIdsByCategory(pMediumCategory), SqlBuilder.IN()) .arrayColumn() .indexOf(pMediumCategory) !== -1;