system.mes.unitOfMeasure.addConversion
Description
Adds a Unit Of Measure Conversions record from one unit of measure to another for the specified material with the specified conversion factor.
Syntax
system.mes.unitOfMeasure.addConversion(fromIdOrName, toIdOrName, conversionFactor, materialId)
Parameters
Parameter | Type | Description |
---|---|---|
fromIdOrName | String | The ULID or name of the from unit of measure to check. |
toIdOrName | String | The ULID or name of the to unit of measure to check. |
conversionFactor | Double | The conversion factor between the units of measure. |
materialId | String (ULID) | The ULID of the material associated with the conversion. |
Returns
Returns a JSON representation of the added unit of measure conversion object.
Code Examples
# Add a unit of measure conversion using the parameters
add_uomc = system.mes.unitOfMeasure.addConversion('Pound', 'Kg', 0.33, '01JCH3TP3Y-4B080WHN-MSR8RVP5')
# Output the JSON representation of the added unit of measure conversion
print(add_uomc)