Skip to main content

system.mes.inventory.validateShipRequest

Validates a ship request based on the provided parameters.

Syntax

system.mes.inventory.validateShipRequest(**ship_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 ship from the location.
unitOfMeasureSymbolStringThe symbol of the unit of measure for the quantity.
lotIdOrNameStringThe ID or name of the inventory lot that will be shipped.
materialIdOrPathStringThe ID or path of the material being shipped.
sourceLocationIdOrPathStringThe ID or path of the location from which inventory will be shipped.
operationIdString (ULID)The ID of the operation shipping this inventory.
productionOrderIdOrNameStringThe ID or name of the production order associated with the ship.
materialReasonCodeIdString (ULID)The ID of the material reason code to add additional context.
startDateInstantThe start date and time of the ship.
endDateInstantThe end date and time of the ship.
ongoingBooleanIndicates whether this request is ongoing.
inventoryNameStringThe name of the inventory the shipped inventory goes to.
notesStringNotes related to the ship 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 ship request object with no initial arguments
ship_request = system.mes.inventory.newShipRequest()

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

# Validate ship request parameters
validation_errors = system.mes.inventory.validateShipRequest(**ship_request)

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