Skip to main content

system.mes.inventory.editInventoryQuantity

Edit inventory quantity from the MES based on the provided parameters.

Syntax

system.mes.inventory.editInventoryQuantity(**edit_inventory_quantity_request)

Parameters

ParameterTypeNullableDescription
typeStringTrueThe type of request defined by the LotRecordType Enum. It is internally set and must not be modified, as changes may break functionality.
newQuantityDoubleFalseThe new quantity to be assigned to the inventory.
unitOfMeasureSymbolStringTrueThe symbol of the unit of measure for the quantity.
lotIdOrNameStringTrueThe ID or name of the inventory lot whose quantity is being edited.
materialIdOrPathStringFalseThe ID or path of the material whose quantity is being edited.
sourceLocationIdOrPathStringFalseThe ID or path of the location from the inventory quantity is being edited.
operationIdString (ULID)TrueThe ID of the operation editing the quantity of this inventory.
inventoryOperationIdString (ULID)TrueThe ID of the inventory operation related to this edit inventory quantity action.
notesStringTrueNotes related to the edit inventory quantity request.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional field for user-defined context.

Returns

Returns a JSON representation of an inventory lot record for an Edit Inventory Quantity Request.

Code Examples

# Generate the object structure for a new edit inventory quantity request object with no initial arguments
new_request = system.mes.inventory.newEditInventoryQuantityRequest()

# Set basic attributes for the new edit inventory quantity request
new_request['materialIdOrPath'] = 'Bottle/Milk'
new_request['sourceLocationIdOrPath'] = 'DairyCo'
new_request['newQuantity'] = 610
# (You can continue setting other properties as needed here)

# Edit the quantity of the inventory
edited_inventory_quantity_request = system.mes.inventory.editInventoryQuantity(**new_request)

# Output the JSON representation of the edit inventory quantity request
print(edited_inventory_quantity_request)