Skip to main content

system.mes.inventory.produce

Produces inventory from the MES based on the provided parameters.

Syntax

system.mes.inventory.produce(**produce_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.
quantityDoubleFalseThe quantity to produce from the location.
unitOfMeasureSymbolStringTrueThe symbol of the unit of measure for the quantity.
lotIdOrNameStringTrueThe ID or name of the inventory lot from which the material is being produced.
materialIdOrPathStringFalseThe ID or path of the material being produced.
destinationLocationIdOrPathStringFalseThe ID or path of the location the produced inventory goes to.
producingLotIdOrNameStringTrueThe ID or name of the inventory lot that will be producing the given lot.
sourceLocationIdOrPathStringTrueThe ID or path of the location from which inventory will be produced.
createIfNotExistsBooleanFalseIndicates whether the system should create the lot if it does not exist. Default value is false.
operationIdString (ULID)TrueThe ID of the operation producing this inventory.
inventoryOperationIdString (ULID)TrueThe ID of the inventory operation related to this produce action.
productionOrderIdOrNameStringTrueThe ID or name of the production order associated with the production.
incrementProductionOrderCountBooleanFalseIndicates whether to increment the production order count. Default value is false.
materialReasonCodeIdString (ULID)TrueThe ID of the material reason code to add additional context.
startDateInstantFalseThe start date and time of the production. Default value is Current Instant.
endDateInstantTrueThe end date and time of the production.
ongoingBooleanFalseIndicates whether this request is ongoing. Default value is false.
inventoryNameStringTrueThe name of the inventory.
notesStringTrueNotes related to the produce 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 a Produce Request.

Code Examples

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

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

# Produce the request
produced_request = system.mes.inventory.produce(**new_request)

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