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
| Parameter | Type | Nullable | Description |
|---|---|---|---|
| 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:
| Key | Default Value |
|---|---|
type | MERGE |
sourceLotId | null |
destinationLotId | null |
locationId | null |
operationId | null |
inventoryOperationId | null |
productionOrderIdOrName | null |
materialReasonCodeId | null |
notes | null |
spare1 | null |
spare2 | null |
spare3 | null |
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)