Skip to main content

system.kanoa.cmms.addMaintenanceSubType(maintenanceSubTypeInfo, userId)

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


Parameters

maintenanceSubTypeInfo Dictionary

- enabledBooleanNot required. Set to True if not passed
- maintenanceSubTypeNameStringName of sub type
- maintenanceTypeIdInteger

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