Skip to main content

system.mes.inventory.getLotsForMaterial

Description

Retrieves a list of all Inventory Lots records in the system for a specified material using its ID or path.

Syntax

system.mes.inventory.getLotsForMaterial(materialIdOrPath)

Parameters

ParameterTypeNullableDescription
materialIdOrPathStringFalseThe ID or path of the material associated with the inventory's lot.

Returns

Returns a list of JSON objects representing all inventory lots for a specified material.

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.

Code Examples

# Retrieve inventory lots for a material
lotsForMaterial = system.mes.inventory.getLotsForMaterial('Bottle/Milk')

# Output the inventory lots
print(lotsForMaterial)