Skip to main content

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

ParameterTypeDescription
fromIdOrNameStringThe ULID or name of the from unit of measure to check.
toIdOrNameStringThe ULID or name of the to unit of measure to check.
conversionFactorDoubleThe conversion factor between the units of measure.
materialIdString (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)