Skip to main content

system.kanoa.lot.updateRouteStep

Requires kanoaOPS license

Description

Updates an existing route step’s properties (route, step number, operation, description, enabled) and audit fields.

Syntax

updateRouteStep(routeStepInfo, userId)

Parameters:

– routeStepInfo (dictionary): Dictionary containing route step details to update.
– userId (int): User ID performing the update.

Returns:

– recordsModified (int): Number of records updated.
– message (string): None if success; error details if an exception occurs.

Behavior

The function updates an existing record in mes.routeStep using the fields provided in routeStepInfo.

– Sets changedBy and changedDate automatically.
– Returns the number of affected rows and None on success; otherwise returns an error message.

Dictionary

ParameterTypeRequiredNotes
routeStepIdintYesIdentifier of the route step to update
routeIdintYesRoute the step belongs to
stepNumintYesSequential step number within the route
lotOperationIdintYesLinked lot operation
stepDescriptionstringNoHuman-readable description for the step
enabledboolNoTrue to enable the step, False to disable it

Code Examples

# Update a route step's operation and description
routeStepInfo = {
"routeStepId": 5001,
"routeId": 101,
"stepNum": 3,
"lotOperationId": 58,
"stepDescription": "Re-inspection before packaging",
"enabled": True
}
recordsModified, msg = system.kanoa.lot.updateRouteStep(
routeStepInfo=routeStepInfo,
userId=123
)
print(recordsModified, msg)

# Disable a step
routeStepInfo = {
"routeStepId": 5002,
"routeId": 101,
"stepNum": 4,
"lotOperationId": 59,
"stepDescription": "Final assembly (temporarily disabled)",
"enabled": False
}
recordsModified, msg = system.kanoa.lot.updateRouteStep(routeStepInfo, 123)
print(recordsModified, msg)