Skip to main content

system.mes.inventory.getInventoryByLotAndLocation

Description

Retrieves the Inventories record based on the inventory lot and location.

Syntax

system.mes.inventory.getInventoryByLotAndLocation(lotIdOrName, materialIdOrPath, locationIdOrPath)

Parameters

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

Returns

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

NameTypeDescription
storageLocationIdString (ULID)The ULID of the storage location of the inventory.
storageLocationPathStringThe path of the storage location of the inventory.
lotIdString (ULID)The ULID of the inventory lot.
lotNameStringThe name of the inventory lot.
lotStatusStringThe status of the inventory lot (e.g OPEN, AVAILABLE, QA_HOLD, EXPIRED, SHIPPED, CLOSED).
quantityDoubleThe current quantity of material in the inventory.
unitOfMeasureIdString (ULID)The ULID of the unit of measure associated with the material.
unitOfMeasureNameStringThe name of the unit of measure associated with the material.
nameStringThe name of the inventory.
productionOrderIdString (ULID)The ULID of the production order associated with the inventory.
productionOrderNameStringThe name of the production order associated with the inventory.
materialIdString (ULID)The ULID of the material associated with the inventory's lot.
materialPathStringThe path of the material associated with the inventory's lot.
materialDescriptionStringThe description of the material associated with the inventory's lot.
materialImageByte[]The image of the material associated with the inventory's lot.
materialClassIdString (ULID)The ULID of the material class associated with the inventory's lot.
materialClassPathStringThe path of the material class associated with the inventory's lot.
idString (ULID)The ULID of the inventory.
notesStringNotes related to the inventory.
enabledBooleanIndicates if the inventory 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 at a lot and location
inventory_lot_location = system.mes.inventory.checkLocationHasCapacity('425e29ed-2780-430a-95cf-79431ec0e3e5', 'Bottle/Milk', 'DairyCo')

# Output the inventory
print(inventory_lot_location)