Skip to main content

system.mes.inventory.newLotHistoryRequest

Generates an empty non-persisted Lot History Request to provide the structure required by the API to retrieve records from the database. This method must be combined with the getLotHistory method to retrieve the records.

Syntax

system.mes.inventory.newLotHistoryRequest()

Parameters

ParameterTypeDescription
None-This method does not take any parameters.

Returns

Returns a JSON representation of the newly created Lot History Request object. The following is a list of keys and default values:

KeyDefault Value
lotIdnull
lotRecordTypenull
operationIdnull
inventoryOperationIdnull
productionOrderIdOrNamenull
materialReasonCodeIdnull
startDatenull
endDatenull
statusnull

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'] = '01JJCPQWYG-T9CW4G6Z-96XBWYQB'
# (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)