system.kanoa.cmms.deleteProcedure(procedureId, userId)
Deletes a procedure by id. Call this to permanently remove a procedure that is no longer needed, such as one created in error or superseded by a revised version. The underlying SQL will block the deletion if the procedure has already been used (for example, referenced by procedure steps, work order events, or other dependent records), so this function is safe to call speculatively � a failed deletion simply returns an error message rather than corrupting referential integrity.
Parameters
procedureId Integer: Id of the procedure to delete
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
msg String None if success
Example
procedureId = 342
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
result, message = system.kanoa.cmms.deleteProcedure(procedureId, userId)
print result, message