Skip to main content

system.kanoa.cmms.addWorkOrderPriority(priorityInfo, userId)

Adds a new work order priority level to the system (e.g. "Low", "Medium", "High", "Emergency"). All keys in priorityInfo are required � this function does not perform a partial insert. On success, the newly generated priority id is returned; on failure, an error message is returned instead.


Parameters

priorityInfo Dictionary

- enabledBoolean
- sortOrderInteger
- workOrderPriorityNameStringName of priority

userId Integer:Id of the user executing the function


Returns

workOrderPriorityId Integer
message String None if success


Example

# Create a new "Emergency" work order priority
priorityInfo = {
"workOrderPriorityName": "Emergency",
"enabled": True,
"sortOrder": 4,
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
workOrderPriorityId, message = system.kanoa.cmms.addWorkOrderPriority(priorityInfo, userId)
print workOrderPriorityId, message