Skip to main content

system.kanoa.cmms.updateProcedureCategory(procedureCategoryInfo, userId)

Updates an existing procedure category's name, parent assignment, or enabled status. Call this function when reorganizing the procedure category hierarchy � for example renaming a category, moving it under a different parentId, or disabling it � passing the userId performing the change for audit purposes. The system enforces a SQL constraint that prevents duplicate procedure category names, so an update that would create a duplicate is rejected. All keys in procedureCategoryInfo are required unless otherwise stated.


Parameters

procedureCategoryInfo Dictionary

- enabledBoolean
- parentIdIntegerCan be None
- procedureCategoryIdInteger
- procedureCategoryNameString

userId Integer:Id of the user executing the function


Returns

# of records modified Boolean
msg String records modified or error message


Example

procedureCategoryInfo = {
"procedureCategoryId": 4,
"procedureCategoryName": "Preventive Maintenance",
"parentId": None,
"enabled": True,
}

userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
result, msg = system.kanoa.cmms.updateProcedureCategory(procedureCategoryInfo, userId)
print result, msg