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

ParameterTypeNullableDescription
operationIdString (ULID)TrueThe ULID of the operation associated with this inventory operation.
operationNameStringTrueThe name of the operation associated with this inventory operation.
nameStringFalseThe name of the inventory operation.
statusStringTrueThe status of the inventory operation.
currentRecordIdString (ULID)TrueThe ULID of the current inventory lot record associated with this inventory operation.
operationTypeStringFalseThe type of operation record for this inventory operation. Default value is CONSUME.
triggerSourceStringFalseThe ways that the various inventory operations can trigger. Default value is EXPRESSION.
startTriggerExpressionStringTrueThe Ignition expression to trigger the start of the transfer of materials.
startTriggerTypeStringTrueThe trigger type when starting the transfer of materials.
stopTriggerExpressionStringTrueThe Ignition expression to trigger the end of the transfer of materials.
stopTriggerTypeStringTrueThe trigger type when stopping the transfer of materials.
sourceLocationIdString (ULID)TrueThe ULID of the location for movement source.
sourceLocationPathStringTrueThe path of the location for movement source.
destinationLocationIdString (ULID)TrueThe ULID of the location for movement destination.
destinationLocationPathStringTrueThe path of the location for movement destination.
materialSourceStringFalseThe strategy used for resolving material ID for an operation. Default value is STATIC.
materialIdString (ULID)TrueThe ULID of the material associated with the inventory operation.
materialPathStringTrueThe path of the material associated with the inventory operation.
materialExpressionStringTrueThe Ignition expression for the material associated with this inventory operation.
primaryLotResolutionStrategyStringFalseThe resolution strategy to get the primary lot code. Default value is AUTO_GENERATE.
secondaryLotResolutionStrategyStringFalseThe resolution strategy to get the secondary lot code. Default value is AUTO_GENERATE.
primaryLotCodeExpressionStringTrueThe Ignition expression to specify the primary lot code.
secondaryLotCodeExpressionStringTrueThe Ignition expression to specify the secondary lot code.
createLotIfNotFoundBooleanTrueIndicates if a lot should be created if it doesn't exist. Only used if operationType is CONSUME.
inventoryNameResolutionStrategyStringFalseThe resolution strategy to get the inventory name. Default value is MANUAL.
inventoryNameStringTrueThe name of the inventory associated with the inventory operation.
inventoryNameExpressionStringTrueThe Ignition expression to specify the inventory name.
quantitySourceStringFalseThe source of the quantity of an inventory operation. Default value is EXPRESSION.
quantityExpressionStringTrueThe Ignition expression to specify the quantity.
quantityCalcTypeStringFalseThe calculation type for quantity. Only used if quantitySource is EXPRESSION. Default value is DELTA.
quantityOverflowValueStringTrueThe overflow value for the quantity. Only used if quantitySource is EXPRESSION and the quantityCalcType is DELTA.
unitOfMeasureIdString (ULID)TrueThe ULID of the unit of measure associated with the inventory operation.
unitOfMeasureNameStringTrueThe name of the unit of measure associated with the inventory operation.
unitOfMeasureResolutionStrategyStringFalseThe source of the unit of measure associated with the inventory operation. Default value is STATIC.
reasonCodeIdString (ULID)TrueThe ULID of the reason code associated with the inventory operation.
reasonCodeNameStringTrueThe name of the reason code associated with the inventory operation.
incrementProductionOrderCountBooleanFalseIndicates if the production order quantity should be updated if we are shipping or producing material. Default value is false.
flushIntervalMillisIntegerTrueThe flush interval in milliseconds. Default value is 0.
idString (ULID)TrueThe ULID of the inventory operation (optional, used for updating an existing inventory operation).
notesStringTrueNotes related to the inventory operation.
enabledBooleanTrueIndicates if the inventory operation is active and enabled.
spare1StringTrueAdditional field for user-defined context.
spare2StringTrueAdditional field for user-defined context.
spare3StringTrueAdditional 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.')