Skip to main content

system.mes.inventory.getLotHistory

Retrieves all Inventory Lot Records given the inventory lot and other parameters.

Syntax

system.mes.inventory.getLotHistory()

Parameters

ParameterTypeDescription
lotIdString (ULID)The ID of the lot to retrieve history for.
lotRecordTypeStringThe type of lot record to retrieve (e.g CONSUME, UNCONSUME, PRODUCE, MOVE, SPLIT, MERGE, SCRAP, RETURN, STATUS_CHANGE, EDIT, RECEIVE, SHIP).
operationIdString (ULID)The ID of the operation to filter by.
inventoryOperationIdString (ULID)The ID of the inventory operation to filter by.
productionOrderIdOrNameStringThe ID or name of the production order to filter by.
materialReasonCodeIdString (ULID)The ID of the material reason code to filter by.
startDateInstantThe start date of the history. Only records created after this date will be returned.
endDateInstantThe end date of the history. Only records created before this date will be returned.
statusStringThe status of the lot record to filter by (e.g IDLE, RUNNING, COMPLETED, FAULTED, CANCELLED, UNKNOWN, PAUSED).

Returns

Returns a list of JSON objects representing all inventory lot records for an inventory lot and other parameters. Each JSON object has the following properties:

NameTypeDescription
lotRecordTypeStringThe type of lot record (e.g CONSUME, UNCONSUME, PRODUCE, MOVE, SPLIT, MERGE, SCRAP, RETURN, STATUS_CHANGE, EDIT, RECEIVE, SHIP).
inventoryLotIdString (ULID)The ID of the inventory lot.
inventoryLotNameStringThe name of the inventory lot.
secondaryInventoryLotIdString (ULID)The ID of the secondary inventory lot. Used based on the lot record type.
secondaryInventoryLotNameStringThe name of the secondary inventory lot. Used based on the lot record type.
operationRecordIdString (ULID)The ID of the operation record associated with this inventory lot.
inventoryOperationIdString (ULID)The ID of the inventory operation associated with the inventory lot.
productionOrderIdString (ULID)The ID of the production order associated with this inventory lot.
materialReasonCodeIdString (ULID)The ID of the material reason code associated with this inventory lot.
sourceLocationIdString (ULID)The ID of the source location. Used based on the lot record type.
destinationLocationIdString (ULID)The ID of the destination location. Used based on the record type.
lotStatusStringThe status of the inventory lot (e.g OPEN, AVAILABLE, QA_HOLD, EXPIRED, SHIPPED, CLOSED).
quantityDoubleThe quantity of material that was affected in the inventory lot record.
startDateInstantThe start date of the inventory lot record.
endDateInstantThe end date of the inventory lot record.
statusStringThe status of the inventory lot record (e.g RUNNING, COMPLETED).
idString (ULID)The ULID of the inventory lot record.
notesStringNotes related to the inventory lot record.
enabledBooleanIndicates if the inventory lot record is active and enabled.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Code Examples

# Generate the object structure for a new lot history request object with no initial arguments
new_lot_history_request = system.mes.inventory.newLotHistoryRequest()

# Set basic attributes for the new lot history request
new_lot_history_request['lotId'] = '01JE6F0CE9-T94PZD8R-TH9J01TJ'
# (You can continue setting other properties as needed here)

# Retrieve the lot history
lot_history = system.mes.inventory.getLotHistory(**new_lot_history_request)

# Output the list of lot history records
print(lot_history)