Skip to main content

system.kanoa.cmms.updateProcedureStep(procedureStepInfo, userId)

Updates an existing procedure step definition, such as a step's name, description, sort order, or estimated duration. Call this when editing a maintenance procedure template in the procedure builder UI � for example, after a technician or planner reorders steps, adjusts the estimated time, or toggles whether a step is required or enabled. All keys in procedureStepInfo are required; the function overwrites the identified step's fields with the values supplied and records userId against the change for audit purposes.


Parameters

procedureStepInfo Dictionary

- enabledBoolean
- estimatedMinutesInteger
- procedureIdIntegerId of procedure
- procedureStepIdIntegerId of procedure step
- requiredBoolean
- sortOrderInteger
- stepConfigString
- stepDescriptionString
- stepNameString

userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

procedureStepInfo = {
"procedureStepId": 4021,
"procedureId": 310,
"stepName": "Inspect belt tension",
"stepDescription": "Check drive belt deflection against spec and adjust tensioner if outside tolerance.",
"stepConfig": "",
"sortOrder": 3,
"estimatedMinutes": 15,
"required": True,
"enabled": True
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
result, message = system.kanoa.cmms.updateProcedureStep(procedureStepInfo, userId)
print result, message