Skip to main content

system.kanoa.cmms.deleteWorkOrderAlertGroups(workOrderId, userId)

Removes all alert group links currently associated with a work order. Use this when a work order's notification setup needs to be cleared out entirely � for example before re-assigning a fresh set of alert groups with addWorkOrderAlertGroups, or when a work order is being closed out and should stop generating group notifications. This operation is not scoped to a single alert group; it deletes every link record tied to the given workOrderId in one call.


Parameters

workOrderId Integer: Id of check sheet
userId Integer:Id of the user executing the function


Returns

# of records modified Integer
msg String None if success


Example

# Clear all existing alert group links before re-assigning a new set
workOrderId = 48213
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, msg = system.kanoa.cmms.deleteWorkOrderAlertGroups(workOrderId, userId)
print recordsModified, msg