diff --git a/process/Observation_lib/process.js b/process/Observation_lib/process.js index 980ff153eaf5cb16b6039873a6fd4481b10dacc1..2eb30d3b1462a82e8ddb03c7d6cb7b3cc7433432 100644 --- a/process/Observation_lib/process.js +++ b/process/Observation_lib/process.js @@ -499,7 +499,7 @@ Observation._syncTempObservationAndObservation = function (pTempObserver, pObser Observation._syncRecordsSpecificValues( pTempObserver[Observation.RECORDS_SPECIFIC_VALUES()], observer[Observation.RECORDS_SPECIFIC_VALUES()] - ); + ); } else { @@ -762,7 +762,9 @@ Observation._createNotification = function (variables) */ Observation.formatFieldValue = function (pRowData, pTypes, pField, pTimezone, pLocale) { - var typeObject = Utils.isObject(pTypes[pField]) ? pTypes[pField] : {type: pTypes[pField]}; + var typeObject = Utils.isObject(pTypes[pField]) ? pTypes[pField] : { + type: pTypes[pField] + }; switch (typeObject.type) { case "DATE": @@ -828,9 +830,17 @@ Observation.cancelAction = function () .and("OBSERVATION.OBSERVER", observer); if (selectedUIDs.length) - { + { + //determine child subscriptions + var observation_ids = newSelect("OBSERVATION.OBSERVATIONID") + .from("OBSERVATION") + .where("OBSERVATION.OBJECT_ID",selectedUIDs, SqlBuilder.IN()) + .arrayColumn(); + cond.and("OBSERVATION.OBJECT_ID", selectedUIDs, SqlBuilder.IN()) - .deleteData(true, "OBSERVATION"); + //add child subscriptions for deletion + cond.or("OBSERVATION.OBSERVATION_ID", observation_ids, SqlBuilder.IN()) + .deleteData(true, "OBSERVATION"); } else {