Skip to main content

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

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


Parameters

maintenanceSubTypeInfo Dictionary

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

userId Integer:Id of the user executing the function


Returns

# of records modified Integer
message String None if success


Example

# Update an existing maintenance sub type's name and re-point it to a different parent maintenance type
maintenanceSubTypeInfo = {
"maintenanceSubTypeId": 14,
"maintenanceSubTypeName": "Bearing Replacement",
"maintenanceTypeId": 3,
"enabled": True
}

userId = system.kanoa.security.getIDPUserId({'userName': 'SYSTEM'})
recordsModified, message = system.kanoa.cmms.updateMaintenanceSubType(maintenanceSubTypeInfo, userId)
print recordsModified, message