system.kanoa.lot.updateRouteStep
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
Parameter | Type | Required | Notes |
---|---|---|---|
routeStepId | int | Yes | Identifier of the route step to update |
routeId | int | Yes | Route the step belongs to |
stepNum | int | Yes | Sequential step number within the route |
lotOperationId | int | Yes | Linked lot operation |
stepDescription | string | No | Human-readable description for the step |
enabled | bool | No | True 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)