Skip to main content

Import distribution routes

Use these steps to give the customers of a distribution unit their visit numbers and times from a text file instead of typing them in the grid. The example imports two routes for a unit with the code D01: the first customer on days 1 and 4, and the second on day 2.

Before you begin​

  • Your licence must include the distribution feature, and you need the Import Distribution Routes permission in Users Management, on the Reports page.
  • The distribution unit and the customer cards must already exist in the file. The import does not create them. The program also does not import routes for a unit that belongs to a replication source other than the one of this file.
  • Save the Coverage Days Count at least once in the coverage options, or every imported visit becomes 0.
  • Prepare the file in UTF-16 (Unicode text), one line per customer, with the columns separated by a tab. The file format is explained in The file format. In the example the six columns are: unit code, customer name, visit 1 and its time, visit 2 and its time:
Unit code Customer Visit 1 Time 1 Visit 2 Time 2
D01 Alnakheel Est. 1 09:00:00 4 09:00:00
D01 Alfajr Est. 2 10:00:00
  • Close the file in any other program that holds it open for writing.
  • Back up the company file if you are going to update existing routes: updating replaces all the visits and times of the route.

Steps​

  1. Open Distribution > Tools > Distribution Tools > Import Distribution Routes. The welcome page appears. Click Next.
  2. Type the file path, D:\data\routes.txt, or click Preview... and choose it, then click Next.
  3. Choose Tab, then click Next.
  4. The option Update Existing Distribution Routes is ticked by default. Leave it ticked if you want to update the routes of customers that already exist in the unit, and clear it if you want to add only new routes. Then click Next.
  5. Type 2 in Start line to skip the header line. Then choose the field of each column in the first row of the grid: Distribution Unit Code for the first column, Customer Name for the second, Visit 1 for the third, Visit 1 Time for the fourth, Visit 2 for the fifth, and Visit 2 Time for the sixth. Check the columns against the lines of the file under the lists.
  6. Click Start. If something is missing, a message names the missing field. Correct it and click Start again.
  7. Answer Yes to the question "Are you sure to start?Import Distribution Routes؟". The bar moves, then the result message appears. Click OK.

Result​

A message shows "Imported records:" and "Unimported records:". In the example they are 2 and 0. The two customers of the file have routes in the unit D01: the first on day 1 at 09:00:00 and on day 4 at 09:00:00, the second on day 2 at 10:00:00. Open Select distribution routes and choose the unit D01 to see them.

A new route is saved even if all its visits are 0. The program also adds its customer to the sub-accounts of the unit's customers account if the customer is not already there. The unit's existing routes that are not in the file do not change. The program does not list the failed lines. If their count is higher than you expect, look for the cause in the table below.

If something goes wrong​

Message or situationWhy it appearsWhat to do
"Must select customer name or account code", or "Must select either distribution unit code or name"You did not choose a column for the customer or for the unit on the last page.Choose the field. Do not choose both of a pair, or a "Must select either ..." message appears.
"An error encountered while opening the file"The file does not exist, or another program holds it open for writing.Correct the path and close the file.
"Unimported records:" is higher by 1 than you expectedYou did not skip the header line, so the program counted it as a failed record.Type 2 in Start line.
A line fails for a customer or a unit that existsThe name or code in the file does not match the customer or unit card, or the unit belongs to another replication source, or the route exists and the update option is cleared.Compare the values with the customer card and the unit card, and tick the update option if the route exists.
The visits became 0 after the importThe number in the file is outside 1 to the Coverage Days Count, or the Coverage Days Count was never saved in the file.Correct the number, or save the Coverage Days Count in the coverage options and import again with the update option ticked.
Every line failed, although the grid on the last page shows them correctlyThe file is not UTF-16. The grid may show UTF-8 files correctly, but the import reads the file two bytes at a time.Save the file as Unicode (UTF-16) and import again.
An existing route lost visits that were not in the fileThe update option replaces all ten visits and their times.Put all the visits you want in the file, or clear the update option.

This page applies to alameen ERP 10, version 10.1.79.764.