Skip to main content

system.mes.inventory.operation.executeInventoryOperation

Description

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

Syntax

system.mes.inventory.operation.executeInventoryOperation(inventoryOperationId, primaryLotIdOrName, quantity, secondaryLotIdOrName, materialIdOrPath, inventoryName, startDate, endDate)

Parameters

ParameterTypeNullableDescription
inventoryOperationIdString (ULID)FalseThe ID of the inventory operation to start.
primaryLotIdOrNameStringFalseThe ID or name of the primary lot to start.
quantityDoubleFalseThe quantity that the inventory operation processed.
secondaryLotIdOrNameStringTrueThe ID or name of the secondary lot to start.
materialIdOrPathStringTrueThe ID or path of the material associated with the inventory operation.
inventoryNameStringTrueThe name of the inventory associated with the inventory operation.
startDateMillisLongTrueThe start date of the inventory operation.
endDateMillisLongTrueThe end date of the inventory operation.

Returns

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

Example Usage

# Executes the inventory operation
executed_lot_record = system.mes.inventory.operation.startInventoryOperation('01JPAND53P-BZ61RZHZ-V7C6EEHG', '01JPBC4H3V-J4X3FYKS-NRNVEKMM', 100, None, None, None, None, None)

# Output the inventory lot record of the executed inventory operation
print(executed_lot_record)