Skip to main content

system.mes.inventory.newReceiveRequest

Description

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

Permissions

This method does not require any permissions.

Syntax

system.mes.inventory.newReceiveRequest()

Parameters

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

Returns

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

KeyDefault Value
typeRECEIVE
quantitynull
unitOfMeasureSymbolnull
lotIdOrNamenull
materialIdOrPathnull
destinationLocationIdOrPathnull
sourceLotIdOrNamenull
sourceMaterialIdOrPathnull
sourceLocationIdOrPathnull
createIfNotExistsfalse
operationIdnull
inventoryOperationIdnull
productionOrderIdOrNamenull
materialReasonCodeIdnull
startDateCurrent Time
endDatenull
ongoingfalse
inventoryNamenull
notesnull
spare1null
spare2null
spare3null

Code Examples

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

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

# Receive the request
receivedRequest = system.mes.inventory.receive(**newRequest)

# Output the JSON representation of the received request
print(receivedRequest)