Skip to main content

system.mes.inventory.operation.validateInventoryOperation

Description

Validates the specified parameters for an Inventory Operation 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 inventory operation type. Default CONSUME.
triggerSourceStringFalseTrigger evaluation strategy. Default EXPRESSION.
startTriggerExpressionStringTrueExpression to trigger start of the operation.
startTriggerTypeStringTrueTrigger type for start. Default RISING_EDGE.
stopTriggerExpressionStringTrueExpression to trigger end of the operation.
stopTriggerTypeStringTrueTrigger type for stop. Default FALLING_EDGE.
sourceLocationIdString (ULID)TrueULID of the source location.
sourceLocationPathStringTruePath of the source location.
destinationLocationIdString (ULID)TrueULID of the destination location.
destinationLocationPathStringTruePath of the destination location.
materialSourceStringFalseMaterial resolution strategy. Default STATIC.
materialIdString (ULID)TrueULID of the material (if STATIC).
materialPathStringTruePath of the material (if STATIC).
materialExpressionStringTrueExpression resolving material (if EXPRESSION).
secondaryMaterialIdString (ULID)TrueULID of the secondary material (optional).
secondaryMaterialPathStringTruePath of the secondary material.
primaryLotResolutionStrategyStringFalseStrategy for primary lot code. Default AUTO_GENERATE.
secondaryLotResolutionStrategyStringFalseStrategy for secondary lot code. Default AUTO_GENERATE.
primaryLotCodeExpressionStringTrueExpression for primary lot code (if strategy EXPRESSION).
secondaryLotCodeExpressionStringTrueExpression for secondary lot code (if strategy EXPRESSION).
createLotIfNotFoundBooleanTrueCreate lot if not found (certain operation types only).
inventoryNameResolutionStrategyStringFalseInventory name resolution strategy. Default STATIC.
inventoryNameStringTrueInventory name (if strategy STATIC).
inventoryNameExpressionStringTrueExpression for inventory name (if strategy EXPRESSION).
quantitySourceStringFalseQuantity source. Default EXPRESSION.
quantityExpressionStringTrueQuantity expression (required if source EXPRESSION).
quantityCalcTypeStringFalseQuantity calculation type. Default DELTA.
quantityOverflowValueDoubleTrueRollover threshold for rising counters when using DELTA.
unitOfMeasureIdString (ULID)TrueULID of the unit of measure (if STATIC).
unitOfMeasureNameStringTrueName of unit of measure.
unitOfMeasureResolutionStrategyStringFalseUnit of measure resolution strategy. Default STATIC.
reasonCodeIdString (ULID)TrueULID of material reason code.
reasonCodeNameStringTrueName of material reason code.
incrementProductionOrderCountBooleanFalseIncrement production order count (shipping/producing). Default false.
idString (ULID)TrueULID of the inventory operation (for update).
notesStringTrueNotes.
enabledBooleanTrueWhether the inventory operation is enabled. Default true.
spare1StringTrueUser-defined field.
spare2StringTrueUser-defined field.
spare3StringTrueUser-defined field.

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.')