system.kanoa.cmms.addMaintenanceType(maintenanceTypeInfo, userId)
Adds a maintenance type. All maintenanceTypeInfo keys are required unless otherwise stated
Parameters
maintenanceTypeInfo Dictionary
| - enabled | Boolean | Not required. Set to True if not passed |
| - maintenanceTypeColor | String | Not required. i.e '#FF000' |
| - maintenanceTypeName | String | Name of sub type |
| - serialId | Integer | Not required. Uses maintenanceWorkorder serial Id if not set |
userId Integer:Id of the user executing the function
Returns
maintenanceTypeId Integer
message String None if success
Example
# Add a new top-level maintenance type
maintenanceTypeInfo = {
"enabled": True,
"maintenanceTypeColor": "#FF5733",
"maintenanceTypeName": "Mechanical"
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
maintenanceTypeId, message = system.kanoa.cmms.addMaintenanceType(maintenanceTypeInfo, userId)
print maintenanceTypeId, message