system.kanoa.cmms.addWorkOrderStatus(statusInfo, userId)
Creates a new work order status code (e.g. "Open", "In Progress", "On Hold", "Closed") that can later be assigned to a work order. Call this when configuring the list of statuses a work order is allowed to move through, rather than when changing an individual work order's current status.
All keys in statusInfo are required � the function does not perform a partial insert, so every field must be supplied even if it holds a default value.
Parameters
statusInfo Dictionary
| - enabled | Boolean | |
| - sortOrder | Integer | |
| - workOrderStatusName | String | Name of status |
userId Integer:Id of the user executing the function
Returns
workOrderStatusId Integer
message String None if success
Example
statusInfo = {
"enabled": True,
"sortOrder": 4,
"workOrderStatusName": "On Hold"
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
workOrderStatusId, message = system.kanoa.cmms.addWorkOrderStatus(statusInfo, userId)
print workOrderStatusId, message