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

ParameterTypeDescription
idOrNameStringThe ID or name of the inventory lot associated with the inventory.
materialIdOrPathStringThe ID or path of the material associated with the inventory's lot.

Returns

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

NameTypeDescription
nameStringThe name of the inventory lot.
materialIdString (ULID)The ULID of the material associated with this inventory lot.
statusStringThe status of the inventory lot.
totalQuantityDoubleThe total quantity of material in the inventory lot.
unitOfMeasureIdString (ULID)The ULID of the unit of measure for the quantity of the inventory lot.
expirationDateInstantThe expected expiration date of the inventory lot.
closedDateInstantThe date that the inventory lot was closed.
supplierIdString (ULID)The ULID of the supplier for the inventory lot.
idString (ULID)The ULID of the inventory lot.
notesStringNotes related to the inventory lot.
enabledBooleanIndicates if the inventory lot is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Example Usage

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

# Output the inventory lot
print(lot_by_name_and_material)