system.kanoa.cmms.updateWorkOrderPriority(priorityInfo, userId)
Updates an existing work order priority's full record (name, enabled status, and sort order).
Unlike updateWorkOrderPriorityField, this replaces the whole configurable record in one call � all keys in priorityInfo are required, including fields that aren't changing.
Parameters
priorityInfo Dictionary
| - enabled | Boolean | |
| - sortOrder | Boolean | |
| - workOrderPriorityId | Integer | Id of priority |
| - workOrderPriorityName | String | Name of priority |
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
message String None if success
Example
# Rename priority id 7 from "Low" to "Minor" and bump its sort order
priorityInfo = {
"workOrderPriorityId": 7,
"workOrderPriorityName": "Minor",
"enabled": True,
"sortOrder": 1,
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateWorkOrderPriority(priorityInfo, currentUserId)
print recordsModified, message