Skip to main content

system.mes.inventory.newMergeRequest

Description

Generates an empty 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.

Permissions

This method does not require any permissions.

Syntax

system.mes.inventory.newMergeRequest()

Parameters

ParameterTypeNullableDescription
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
inventoryOperationIdnull
productionOrderIdOrNamenull
materialReasonCodeIdnull
notesnull
spare1null
spare2null
spare3null

Code Examples

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

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

# Merge the request
mergedRequest = system.mes.inventory.merge(**newRequest)

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