Skip to main content

system.mes.inventory.operation.validateInventoryOperation

Description

Validates the specified parameters for an Inventory Operations record and returns any validation errors. This only checks if the inventory operation object can be saved based on the attributes given.

Syntax

system.mes.inventory.operation.validateInventoryOperation(**inventory_operation_data)

Parameters

ParameterTypeDescription
operationIdString (ULID)The ULID of the operation associated with this inventory operation.
operationNameStringThe name of the operation associated with this inventory operation.
nameStringThe name of the inventory operation.
statusStringThe status of the inventory operation.
currentRecordIdString (ULID)The ULID of the current inventory lot record associated with this inventory operation.
operationTypeStringThe type of operation record for this inventory operation.
triggerSourceStringThe ways that the various inventory operations can trigger.
startTriggerExpressionStringThe Ignition expression to trigger the start of the transfer of materials.
startTriggerTypeStringThe trigger type when starting the transfer of materials.
stopTriggerExpressionStringThe Ignition expression to trigger the end of the transfer of materials.
stopTriggerTypeStringThe trigger type when stopping the transfer of materials.
sourceLocationIdString (ULID)The ULID of the location for movement source.
sourceLocationPathStringThe path of the location for movement source.
destinationLocationIdString (ULID)The ULID of the location for movement destination.
destinationLocationPathStringThe path of the location for movement destination.
materialSourceStringThe strategy used for resolving material ID for an operation.
materialIdString (ULID)The ULID of the material associated with the inventory operation.
materialPathStringThe path of the material associated with the inventory operation.
materialExpressionStringThe Ignition expression for the material associated with this inventory operation.
primaryLotResolutionStrategyStringThe resolution strategy to get the primary lot code.
secondaryLotResolutionStrategyStringThe resolution strategy to get the secondary lot code.
primaryLotCodeExpressionStringThe Ignition expression to specify the primary lot code.
secondaryLotCodeExpressionStringThe Ignition expression to specify the secondary lot code.
createLotIfNotFoundBooleanIndicates if a lot should be created if it doesn't exist. Only used if operationType is CONSUME.
inventoryNameResolutionStrategyStringThe resolution strategy to get the inventory name.
inventoryNameStringThe name of the inventory associated with the inventory operation.
inventoryNameExpressionStringThe Ignition expression to specify the inventory name.
quantitySourceStringThe source of the quantity of an inventory operation.
quantityExpressionStringThe Ignition expression to specify the quantity.
quantityCalcTypeStringThe calculation type for quantity. Only used if quantitySource is EXPRESSION.
quantityOverflowValueStringThe overflow value for the quantity. Only used if quantitySource is EXPRESSION and the quantityCalcType is RISING.
unitOfMeasureIdString (ULID)The ULID of the unit of measure associated with the inventory operation.
unitOfMeasureNameStringThe name of the unit of measure associated with the inventory operation.
unitOfMeasureResolutionStrategyStringThe source of the unit of measure associated with the inventory operation.
reasonCodeIdString (ULID)The ULID of the reason code associated with the inventory operation.
reasonCodeNameStringThe name of the reason code associated with the inventory operation.
incrementProductionOrderCountBooleanIndicates if the production order quantity should be updated if we are shipping or producing material.
flushIntervalMillisIntegerThe flush interval in milliseconds.
idString (ULID)The ULID of the inventory operation (optional, used for updating an existing inventory operation).
notesStringNotes related to the inventory operation.
enabledBooleanIndicates if the inventory operation is active and enabled.
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 inventory operation object
inventory_operation_data = system.mes.inventory.operation.newInventoryOperation()

# Set basic attributes for the new inventory operation
inventory_operation_data['name'] = 'Lids'
inventory_operation_data['sourceLocationId'] = '01JD7M94CJ-HPEQEJ1F-QA8EQ6VE'
# (You can continue setting other properties as needed here)

# Validate inventory operation parameters
validation_errors = system.mes.inventory.operation.validateInventoryOperation(**inventory_operation_data)

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