system.kanoa.cmms.updateProcedure(procedureInfo, userId)
Updates an existing procedure's core details, including its name, category assignment, and enabled status. Call this function when a procedure needs to be renamed, re-categorized, or enabled/disabled, passing the procedureId of the record to update along with the userId performing the change for audit purposes.
Unlike updateProcedureField, this function updates the full set of required fields at once, so every key in procedureInfo is required unless otherwise stated.
Parameters
procedureInfo Dictionary
| - enabled | Boolean | Not required. Will be set to True |
| - procedureCategoryId | Integer | |
| - procedureDescription | String | Not required |
| - procedureId | Integer | Id of procedure |
| - procedureName | String | Name of procedure |
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
message String None if success
Example
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
procedureInfo = {
'procedureId: 34,
'enabled': False,
'procedureCategoryId': None,
'procedureName': 'CNC Lube',
'procedureDescription': 'CNC Coolant and Lubrication Service'
}
retVal, msg = system.kanoa.cmms.updateProcedure(procedureInfo, userId)
print retVal, msg