Skip to main content

system.mes.inventory.newMergeRequest

Generates an empty non-persisted Merge Request to provide the structure required by the API to save a new record into the database. This method must be combined with the merge method in order to persist the record.

Syntax

system.mes.inventory.newMergeRequest()

Parameters

ParameterTypeDescription
None-This method does not take any parameters.

Returns

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

KeyDefault Value
typeMERGE
sourceLotIdnull
destinationLotIdnull
locationIdnull
operationIdnull
productionOrderIdOrNamenull
materialReasonCodeIdnull
notesnull
spare1null
spare2null
spare3null

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)