system.kanoa.lot.addRouteStep
Description
Adds a new step to an existing route.Syntax
addRouteStep(routeStepInfo, userId)Parameters:
– routeStepInfo (dictionary): Dictionary containing route step details.
– userId (int): User ID performing the insert.
Returns:
– routeStepId (int): ID of the newly created route step.
– message (string): None if success; error details if an exception occurs.
Behavior
The function inserts a new record into the mes.routeStep table, linking it to an existing route and operation.– Creates a new step with the specified step number, operation, and description.
– Automatically sets audit fields (createdBy and createdDate).
– Returns the new routeStepId upon success or an error message if the insert fails.
Dictionary
Parameter | Type | Required | Notes |
---|---|---|---|
routeId | int | Yes | ID of the route the step belongs to |
stepNum | int | Yes | Sequential step number in the route |
lotOperationId | int | Yes | ID of the linked lot operation |
stepDescription | string | No | Description or notes for the route step (optional) |
enabled | bool | No | True to enable the step, False to disable it |
Code Examples
# Add a new route step
routeStepInfo = {
"routeId": 101,
"stepNum": 3,
"lotOperationId": 55,
"stepDescription": "Inspection before packaging",
"enabled": True
}
routeStepId, msg = system.kanoa.lot.addRouteStep(routeStepInfo=routeStepInfo, userId=123)
print(routeStepId, msg)
# Add a disabled route step
routeStepInfo = {
"routeId": 101,
"stepNum": 4,
"lotOperationId": 56,
"stepDescription": "Final assembly",
"enabled": False
}
routeStepId, msg = system.kanoa.lot.addRouteStep(routeStepInfo, 123)
print(routeStepId, msg)