Skip to main content

system.mes.inventory.getLotByIdOrNameAndMaterial

Description

Retrieves an Inventory Lots record by its ID or name and by the material ID or path. If no material ID or path is provided, retrieves an Inventory Lots record by its ID or name.

Syntax

system.mes.inventory.getLotByIdOrNameAndMaterial(idOrName, materialIdOrPath)

Parameters

ParameterTypeNullableDescription
idOrNameStringFalseThe ID or name of the inventory lot associated with the inventory.
materialIdOrPathStringTrueThe ID or path of the material associated with the inventory's lot.

Returns

Returns a JSON representation of an inventory lot with the following properties:

NameTypeDescription
idString (ULID)Unique identifier for the inventory lot.
notesStringNotes associated with the inventory lot.
enabledBooleanIndicates whether the inventory lot is enabled (default: true).
spare1StringExtra field 1 for additional context.
spare2StringExtra field 2 for additional context.
spare3StringExtra field 3 for additional context.
nameStringThe name of the inventory lot.
materialIdString (ULID)The id of the material in the inventory lot.
materialPathStringThe path of the material in the inventory lot.
materialNameStringThe name of the material in the inventory lot.
materialQuantityFormatStringThe quantity format of the material in the inventory lot.
statusLotStatusThe status of the inventory lot (default: OPEN).
totalQuantityDoubleThe total quantity of material added to the inventory lot (default: 0.0).
unitOfMeasureIdString (ULID)The id of the unit of measure of the material in the inventory lot.
unitOfMeasureNameStringThe name of the unit of measure of the material in the inventory lot.
unitOfMeasureSymbolStringThe symbol of the unit of measure of the material in the inventory lot.
expirationDateInstantThe expected expiration date of the inventory lot.
closedDateInstantThe date that this inventory lot was closed.
createdDateInstantThe date that this inventory lot was created.

Example Usage

# Retrieve inventory lot by name and material
lotByNameAndMaterial = system.mes.inventory.getLotByIdOrNameAndMaterial('21220', 'Bottle/Milk')

# Output the inventory lot
print(lotByNameAndMaterial)