Skip to main content
Version: V3 (Ignition 8.3)

system.mes.inventory.newProduceRequest

Description​

Generates an empty Produce Request to provide the structure required by the API to save a new record into the database. This method must be combined with the produce method in order to persist the record.

Permissions​

This method does not require any permissions.

Syntax​

system.mes.inventory.newProduceRequest()

Parameters​

ParameterTypeNullableDescription
None--This method does not take any parameters.

Returns​

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

KeyDefault Value
typePRODUCE
quantitynull
unitOfMeasureSymbolnull
lotIdOrNamenull
materialIdOrPathnull
destinationLocationIdOrPathnull
producingLotIdOrNamenull
producingMaterialIdOrPathnull
sourceLocationIdOrPathnull
createIfNotExistsfalse
operationIdnull
inventoryOperationIdnull
productionOrderIdOrNamenull
incrementProductionOrderCountfalse
materialReasonCodeIdnull
startDateCurrent Time
endDatenull
ongoingfalse
inventoryNamenull
notesnull
spare1null
spare2null
spare3null

Code Examples​

# Generate the object structure for a new produce request object with no initial arguments
newRequest = system.mes.inventory.newProduceRequest()

# Set basic attributes for the new produce request
newRequest['materialIdOrPath'] = 'Bottle/Milk'
newRequest['destinationLocationIdOrPath'] = 'DairyCo'
newRequest['quantity'] = 610
# (You can continue setting other properties as needed here)

# Produce the request
producedRequest = system.mes.inventory.produce(**newRequest)

# Output the JSON representation of the produced request
print(producedRequest)