Skip to main content

system.mes.inventory.merge

Merges inventory from the MES based on the provided parameters.

Syntax

system.mes.inventory.merge(**merge_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.
sourceLotIdString (ULID)The ID of the lot that will be merged and closed.
destinationLotIdString (ULID)The ID of the final inventory lot that will be merged into.
locationIdString (ULID)The ID of the location the merged inventory goes to.
operationIdString (ULID)The ID of the operation merging this inventory.
productionOrderIdOrNameStringThe ID or name of the production order associated with the merge.
materialReasonCodeIdString (ULID)The ID of the material reason code to add additional context.
notesStringNotes related to the merge 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 Merge Request.

Code Examples

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

# Set basic attributes for the new merge request
new_request['sourceLotId'] = '01JJD0ST06-APPRGRCY-25ZQ49FR'
new_request['destinationLotId'] = '01JJCPQWYG-T9CW4G6Z-96XBWYQB'
# (You can continue setting other properties as needed here)

# Merge the request
merged_request = system.mes.inventory.merge(**new_request)

# Output the JSON representation of the merged request
print(merged_request)