Skip to main content

system.mes.inventory.validateMoveRequest

Validates a move request based on the provided parameters.

Syntax

system.mes.inventory.validateMoveRequest(**move_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.
quantityDoubleThe quantity to move from the location.
unitOfMeasureSymbolStringThe symbol of the unit of measure for the quantity.
lotIdOrNameStringThe ID or name of the inventory lot to move.
materialIdOrPathStringThe ID or path of the material being moved.
sourceLocationIdOrPathStringThe ID or path of the location from which inventory will be moved.
destinationLocationIdOrPathStringThe ID or path of the location the moved inventory goes to.
operationIdString (ULID)The ID of the operation moving this inventory.
productionOrderIdOrNameStringThe ID or name of the production order associated with the move.
materialReasonCodeIdString (ULID)The ID of the material reason code to add additional context.
startDateInstantThe start date and time of the move.
endDateInstantThe end date and time of the move.
ongoingBooleanIndicates whether this request is ongoing.
destinationInventoryNameStringThe name of the inventory the moved inventory goes to.
notesStringNotes related to the move request.
spare1StringAdditional field for user-defined context.
spare2StringAdditional field for user-defined context.
spare3StringAdditional field for user-defined context.

Returns

Returns a JSON object where keys are field names and values are lists of validation violation messages.

Code Examples

# Generate the object structure for a new move request object with no initial arguments
move_request = system.mes.inventory.newMoveRequest()

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

# Validate move request parameters
validation_errors = system.mes.inventory.validateMoveRequest(**move_request)

if len(validation_errors) > 0:
print('Validation errors found:', validation_errors)
else:
print('Move request parameters are valid.')