system.kanoa.cmms.addMaintenanceSubType(maintenanceSubTypeInfo, userId)
Adds a maintenance sub type. All maintenanceSubTypeInfo keys are required unless otherwise stated
Parameters
maintenanceSubTypeInfo Dictionary
| - enabled | Boolean | Not required. Set to True if not passed |
| - maintenanceSubTypeName | String | Name of sub type |
| - maintenanceTypeId | Integer |
userId Integer:Id of the user executing the function
Returns
maintenanceSubTypeId Integer
message String None if success
Example
# Add a new maintenance sub type under an existing parent maintenance type
maintenanceSubTypeInfo = {
"enabled": True,
"maintenanceSubTypeName": "Bearing Replacement",
"maintenanceTypeId": 4 # id of the "Mechanical" MaintenanceType
}
userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
maintenanceSubTypeId, message = system.kanoa.cmms.addMaintenanceSubType(maintenanceSubTypeInfo, userId)
print maintenanceSubTypeId, message