Skip to main content

system.mes.inventory.newInventoryLotRecord

Generates an empty non-persisted Inventory Lot Records object to provide the structure required by the API to save a new record into the database. This method must be combined with the saveInventoryLotRecord method in order to persist the record.

Syntax

system.mes.inventory.newInventoryLotRecord()

Parameters

ParameterTypeDescription
None-This method does not take any parameters.

Returns

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

KeyDefault Value
lotRecordTypenull
inventoryLotIdnull
inventoryLotNamenull
secondaryInventoryLotIdnull
secondaryInventoryLotNamenull
operationRecordIdnull
inventoryOperationIdnull
productionOrderIdnull
materialReasonCodeIdnull
sourceLocationIdnull
destinationLocationIdnull
lotStatusnull
quantitynull
startDateCurrent Time
endDatenull
statusnull
idnull
notesnull
enabledtrue
spare1null
spare2null
spare3null

Code Examples

# Generate the object structure for a new inventory lot record object with no initial arguments
new_lot_record = system.mes.inventory.newInventoryLotRecord()

# Set basic attributes for the new inventory lot record
new_lot_record['lotRecordType'] = 'CONSUME'
new_lot_record['inventoryLotId'] = '01JE6F0CE9-T94PZD8R-TH9J01TJ'
new_lot_record['status'] = 'COMPLETED'
# (You can continue setting other properties as needed here)

# Save the new inventory lot record to the system
saved_lot_record = system.mes.inventory.saveInventoryLotRecord(**new_lot_record)

# Output the JSON representation of the saved inventory lot record
print(saved_lot_record)