system.kanoa.cmms.updateWorkOrderStatus(statusInfo, userId)
Updates an existing work order status code identified by workOrderStatusId.
Call this when renaming a status, re-ordering it in a status list, or toggling whether it is enabled � for example changing "In Progress" to "In Progress - Awaiting Parts".
All keys in statusInfo are required, so this is a full-record update rather than a partial patch; use updateWorkOrderStatusField instead if only a single field needs to change.
Parameters
statusInfo Dictionary
| - enabled | Boolean | |
| - sortOrder | Integer | |
| - workOrderStatusId | Integer | Id of status |
| - workOrderStatusName | String | Name of status |
userId Integer:Id of the user executing the function
Returns
# of records modified Integer
message String None if success
Example
statusInfo = {
"enabled": True,
"sortOrder": 2,
"workOrderStatusId": 3,
"workOrderStatusName": "In Progress"
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateWorkOrderStatus(statusInfo, userId)
print recordsModified, message