Skip to main content

system.mes.inventory.newInventoryLotRecord

Description

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.

Permissions

This method does not require any permissions.

Syntax

system.mes.inventory.newInventoryLotRecord()

Parameters

ParameterTypeNullableDescription
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
newLotRecord = system.mes.inventory.newInventoryLotRecord()

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

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

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