Skip to main content

system.mes.inventory.newEditInventoryQuantityRequest

Generates an empty non-persisted Edit Inventory Quantity Request to provide the structure required by the API to save a new record into the database. This method must be combined with the editInventoryQuantity method in order to persist the record.

Syntax

system.mes.inventory.newEditInventoryQuantityRequest()

Parameters

ParameterTypeDescription
None-This method does not take any parameters.

Returns

Returns a JSON representation of the newly created Edit Inventory Quantity Request object. The following is a list of keys and default values:

KeyDefault Value
typeEDIT
newQuantitynull
unitOfMeasureSymbolnull
lotIdOrNamenull
materialIdOrPathnull
sourceLocationIdOrPathnull
operationIdnull
notesnull
spare1null
spare2null
spare3null

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)