Skip to main content

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

- enabledBooleanNot required. Will be set to True
- procedureCategoryIdInteger
- procedureDescriptionStringNot required
- procedureIdIntegerId of procedure
- procedureNameStringName 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