system.mes.unitOfMeasure.getUnitOfMeasureOrCreateNew
Description
Retrieves a Units Of Measure record if an existing unit of measure exists with the specified name and symbol. Otherwise, creates a new Units Of Measure record with the specified name and symbol.
Syntax
system.mes.unitOfMeasure.getUnitOfMeasureOrCreateNew(name, symbol)
Parameters
Parameter | Type | Description |
---|---|---|
name | String | The name of the unit of measure. |
symbol | String | The symbol of the unit of measure. |
Returns
Returns a JSON representation of the unit of measure property.
Code Examples
# Get the unit of measure if it exists, otherwise creates it with the the parameters
uom = system.mes.unitOfMeasure.getUnitOfMeasureOrCreateNew('Pound', 'lb')
# Output the JSON representation of the unit of measure
print(uom)