Minimum Version Required: 22.01
Pre-Conditions
You need appropriate permissions to edit routes (RouteEdit permission)
Location and route version data must be properly configured in your database
User accounts referenced in the import file must exist in the system
Activity records must exist for any activity IDs referenced
Steps
The Routes EDBL routine allows importing or updating routes and stops data. This routine handles complex routing configurations including route versions, customer assignments, sequence ordering, and vehicle assignments.
The import process follows these steps:
Processes location data, translating from LocationID_Translation if provided
Sets default route version to 'A' if not specified
Updates existing route versions or creates new ones
Creates missing product groups if needed
Updates route information and bindings
Processes customer assignments to routes
Updates or creates stops based on customer assignments
Updates sequence numbers for stops
Handles customer location moves if requested
Updates the data warehouse
If your implementation uses a Phase-based route system, the Phase field is expected. For Scheduler-based systems, fields like StartOnDate, StartWeekFrom, RepeatEvery, and WeekOfMonth are utilized.
When using MoveCustomers=1, the system will attempt to move customers to the specified location. The area name in the destination location must start with the location name (e.g., "Raleigh Clayton" area would be valid for "Clayton" location).
The ClearStopsWithSameRouteNum flag allows deleting existing stops with the same route number before importing new stops.
Fields And Definitions
Core Routing Information:
LocationID_Translation - Text identifier for the location that will be translated to a LocationID
LocationID - Integer ID of the location (defaults to the current user's LocationID)
RouteVersion - Text identifier for the route version (defaults to 'A')
RouteVersionID_Translation - Text that combines location and route version for translation
RouteVersionID - Integer ID for the route version
RouteTypeID - Integer ID for the route type
RouteType - Text name of the route type
Route - Text name of the route (generated from RouteNum and day if not provided)
RouteNum - Integer identifying the route number
DayOfWeek - Integer (1-7) representing day of week (1=Sunday, 7=Saturday)
User Assignment:
UserID - Integer ID of the user assigned to the route
UserFullName - Text full name of the user (used to look up UserID)
UserName - Text username (used to look up UserID)
Customer and Stop Information:
CustomerID_Translation - Text identifier for the customer that will be translated to a CustomerID
CustomerID - Integer ID of the customer
Sequence - Integer determining the delivery sequence for the stop
ProductGroupID - Integer ID of the product group
ProductGroupID_Translation - Text identifier for product group
ProductGroup - Text name of the product group
PerpetualInventory - Boolean indicating if perpetual inventory is enabled
Scheduling Fields:
Phase - Integer representing the phase (Phase-based routing)
StartOnDate - Date when the route starts (Scheduler-based routing)
StartWeekFrom - Integer for starting week (Scheduler-based routing)
RepeatEvery - Integer for repetition interval (Scheduler-based routing)
WeekOfMonth - Integer week of month (Scheduler-based routing)
PresellDaysInAdvance - Integer days to presell
Activity Information:
ActivityID - Integer ID of the activity
Activity - Text name of the activity
StopActivityID - Integer ID for stop activity
StopActivity - Text name for stop activity
Route Operations:
StartTime - Time when the route starts
EndTime - Time when the route ends
StartMapPoint - Text name of starting map point
EndMapPoint - Text name of ending map point
VehicleID - Integer ID of the vehicle
Vehicle - Text name of the vehicle
AssignmentGroup - Text name of assignment group
ClearStopsWithSameRouteNum - Integer (0/1) flag to clear existing stops with the same route number
MoveCustomers - Integer (0/1) flag to move customers between locations
RouteVersionStartDate - Date when the route version starts
Best Practices
Always provide a RouteNum and DayOfWeek to ensure routes are properly identified
Use LocationID_Translation if importing routes between different environments
Set ClearStopsWithSameRouteNum to 1 only when you want to completely replace all stops for a route
Provide UserName or UserFullName to ensure routes are assigned to the correct users
If moving customers between locations (MoveCustomers=1), ensure area names in the destination location start with the location name
Set a valid RouteVersionStartDate when creating a new route version
For route scheduling, ensure proper values for Phase (Phase-based) or StartOnDate/StartWeekFrom (Scheduler-based)
Use ProductGroup names or IDs to ensure proper product grouping for stops
Provide a Sequence value for each stop to maintain the correct delivery order
If using TranslationMobilityRouteNum, ensure it matches your mobile system's route numbering