Skip to main content

system.mes.inventory.operation.executeInventoryOperation

Description

Executes an Inventory Operation and creates a new inventory lot record without having to start and then stop the operation. If the Inventory Operation is already started, this will act as a stopInventoryOperation call.

Syntax

system.mes.inventory.operation.executeInventoryOperation(inventoryOperationId, primaryLotIdOrName, quantity, secondaryLotIdOrName, materialIdOrPath, inventoryName, startDateMillis, endDateMillis)

Parameters

ParameterTypeNullableDescription
inventoryOperationIdString (ULID)FalseThe ID of the inventory operation to execute.
primaryLotIdOrNameStringFalseThe ID or name of the primary lot.
quantityDoubleFalseThe quantity the inventory operation will process.
secondaryLotIdOrNameStringTrueThe ID or name of the secondary lot, if required.
materialIdOrPathStringTrueThe ID or path of the material associated with the inventory operation.
inventoryNameStringTrueThe name of the inventory associated with the inventory operation.
startDateMillisLongTrueThe start timestamp (ms since epoch) for the lot record.
endDateMillisLongTrueThe end timestamp (ms since epoch) for the lot record.

Returns

Returns a JSON object of the inventory lot record for the executed inventory operation.

Example Usage

# Execute a full inventory operation in a single call
executed_lot_record = system.mes.inventory.operation.executeInventoryOperation(
'01JPAND53P-BZ61RZHZ-V7C6EEHG', # inventoryOperationId
'01JPBC4H3V-J4X3FYKS-NRNVEKMM', # primaryLotIdOrName
100.0, # quantity
None, # secondaryLotIdOrName
None, # materialIdOrPath
None, # inventoryName
None, # startDateMillis
None # endDateMillis
)

print(executed_lot_record)