Skip to main content

system.mes.equipment.validateEquipmentPropertyValue

Description

Validates the specified parameters for an Equipment Property Values record and returns any validation errors. This only checks if the equipment property value object can be saved based on the attributes given, without actually creating or modifying the value.

Permissions

This method requires the EQUIPMENT.READ.VALIDATE permission.

Syntax

system.mes.equipment.validateEquipmentPropertyValue(**propertyValueData)

Parameters

ParameterTypeNullableDescription
equipmentIdString (ULID)FalseThe ULID of the equipment this property value belongs to.
equipmentPropertyIdString (ULID)FalseThe ULID of the equipment property that defines this value.
dataTypeStringTrueThe data type of the value. Default value is String.
valueMixedTrueThe actual value. Type depends on the property's data type.
idString (ULID)TrueThe ULID of the equipment property value. Used when updating.
notesStringTrueNotes related to the property value.
enabledBooleanTrueIndicates if this property value is active. Default value is true.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.

Returns

Returns a JSON object where keys are field names and values are lists of validation violation messages.

Code Examples

valueData = system.mes.equipment.newEquipmentPropertyValue()
valueData['equipmentId'] = system.mes.equipment.getEquipment('Pumps/CentrifugalPumps/Pump-101')['id']
valueData['equipmentPropertyId'] = system.mes.equipment.getEquipmentProperty('MaxFlowRate')['id']
valueData['value'] = 250.0
validationErrors = system.mes.equipment.validateEquipmentPropertyValue(**valueData)
if len(validationErrors) > 0:
print('Validation errors found:', validationErrors)
else:
print('Equipment property value parameters are valid.')