Skip to main content

system.mes.inventory.newLotHistoryRequest

Description

Generates an empty 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.

Permissions

This method does not require any permissions.

Syntax

system.mes.inventory.newLotHistoryRequest()

Parameters

ParameterTypeNullableDescription
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
lotRoleFilterALL

Code Examples

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

# Set basic attributes for the new lot history request
newLotHistoryRequest['lotId'] = '01JJCPQWYG-T9CW4G6Z-96XBWYQB'
# (You can continue setting other properties as needed here)

# Retrieve the lot history
lotHistory = system.mes.inventory.getLotHistory(**newLotHistoryRequest)

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