Skip to main content

system.kanoa.cmms.addMaintenanceType(maintenanceTypeInfo, userId)

Adds a maintenance type. All maintenanceTypeInfo keys are required unless otherwise stated


Parameters

maintenanceTypeInfo Dictionary

- enabledBooleanNot required. Set to True if not passed
- maintenanceTypeColorStringNot required. i.e '#FF000'
- maintenanceTypeNameStringName of sub type
- serialIdIntegerNot 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