system.kanoa.cmms.deleteProcedureStepCheckEvent(procedureStepCheckEventId, userId)
Deletes a single procedure step check event record, identified by its ID, and records the deleting user for audit purposes. Call this when a supervisor needs to remove an erroneous or duplicate check event that was logged during a maintenance procedure's execution - for example, cleaning up a check event that was captured against the wrong step, or removing test data before go-live. The database enforces referential integrity on this operation: if the check event has already been consumed elsewhere (e.g., rolled up into a completed work order event), the delete is rejected and the reason is returned in the message.
Parameters
procedureStepCheckEventId Integer: Id of the procedure step check event to delete
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
msg String None if success
Example
# Remove a check event that was logged against the wrong step
procedureStepCheckEventId = 4521
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, msg = system.kanoa.cmms.deleteProcedureStepCheckEvent(procedureStepCheckEventId, userId)
print recordsModified, msg