diff --git a/process/Observation_lib/process.js b/process/Observation_lib/process.js index 4f7986e3dc0e5c541b02f40c44d7026835c8dfd6..8d70794e10ef10610357918fa9fdf383a454cbc8 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 {