Skip to main content

system.kanoa.lot.updateRouteField

Requires kanoaOPS license

Description

Updates a specific field in a route record based on the given routeId.

Syntax

updateRouteField(routeId, field, value, userId)

Parameters:

– routeId (int): The ID of the route to update.
– field (string): The name of the field/column to modify.
– value (pyObject): The new value to assign to the field.
– userId (int): The ID of the user performing the update.

Returns:

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

Behavior

The function performs a direct update on a single column of a route record within the mes.route table.

– Automatically updates the audit fields changedBy and changedDate.
– Returns the number of affected records and None if successful.
– Returns an error message if the update fails.

Parameters

ParameterTypeRequiredNotes
routeIdintYesID of the route to update
fieldstringYesName of the field (column) to modify
valuepyObjectYesNew value to assign to the specified field
userIdintYesID of the user making the change

Code Examples

# Update the route name
recordsModified, msg = system.kanoa.lot.updateRouteField(
routeId=12,
field="routeName",
value="Assembly Line 3 - Revised",
userId=123
)
print(recordsModified, msg)

# Disable a route
recordsModified, msg = system.kanoa.lot.updateRouteField(
routeId=15,
field="enabled",
value=False,
userId=123
)
print(recordsModified, msg)