Skip to main content

system.mes.inventory.operation.stopInventoryOperation

Description

Stops the Inventory Operation with the provided id. This action finds the currently running inventory lot record, records the specified quantity and end state into it, sets its end time to the specified date (or current time if not specified), and updates its status to completed. This effectively concludes the active operation and finalizes the lot record.

Syntax

system.mes.inventory.operation.stopInventoryOperation(inventoryOperationId, quantity, inventoryName, endDate)

Parameters

ParameterTypeNullableDescription
inventoryOperationIdString (ULID)FalseThe ID of the inventory operation to end.
quantityDoubleFalseThe quantity that the inventory operation processed.
inventoryNameStringTrueThe name of the inventory associated with the inventory operation.
endDateMillisLongTrueThe end date of the inventory operation.

Returns

Returns a JSON object of the updated inventory lot record with the completed operation details, including the end time and final quantity.

Example Usage

# Stop the inventory operation
stopped_lot_record = system.mes.inventory.operation.stopInventoryOperation('01JPAND53P-BZ61RZHZ-V7C6EEHG', 100, None, None)

# Output the inventory lot record of the stopped inventory operation
print(stopped_lot_record)