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
| Parameter | Type | Nullable | Description |
|---|---|---|---|
equipmentId | String (ULID) | False | The ULID of the equipment this property value belongs to. |
equipmentPropertyId | String (ULID) | False | The ULID of the equipment property that defines this value. |
dataType | String | True | The data type of the value. Default value is String. |
value | Mixed | True | The actual value. Type depends on the property's data type. |
id | String (ULID) | True | The ULID of the equipment property value. Used when updating. |
notes | String | True | Notes related to the property value. |
enabled | Boolean | True | Indicates if this property value is active. Default value is true. |
spare1 | String | True | Additional field for user-defined context. |
spare2 | String | True | Additional field for user-defined context. |
spare3 | String | True | Additional 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.')