Skip to main content

system.mes.inventory.receive

Receives inventory into the MES based on the provided parameters.

Syntax

system.mes.inventory.receive(**receive_request)

Parameters

ParameterTypeDescription
typeStringThe type of request defined by the LotRecordType Enum. It is internally set and must not be modified, as changes may break functionality.
quantityDoubleThe quantity to receive from the location.
unitOfMeasureSymbolStringThe symbol of the unit of measure for the quantity.
lotIdOrNameStringThe ID or name of the inventory lot from which the material is being received.
materialIdOrPathStringThe ID or path of the material being received.
destinationLocationIdOrPathStringThe ID or path of the location the received inventory goes to.
createIfNotExistsBooleanIndicates whether the system should create the lot if it does not exist.
operationIdString (ULID)The ID of the operation receiving this inventory.
productionOrderIdOrNameStringThe ID or name of the production order associated with the receipt.
materialReasonCodeIdString (ULID)The ID of the material reason code to add additional context.
startDateInstantThe start date and time of the receipt.
endDateInstantThe end date and time of the receipt.
ongoingBooleanIndicates whether this request is ongoing.
inventoryNameStringThe name of the inventory.
notesStringNotes related to the receive request.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Returns

Returns a JSON representation of an inventory lot record for a Receive Request.

Code Examples

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

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

# Receive the request
received_request = system.mes.inventory.receive(**new_request)

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