Skip to main content

Attaché: Import customer invoices using Keystroke File Import

Updated over 3 months ago

You can import into any screen in Attaché using a Keystroke File Import (KFI) file.

KFI is a very powerful and flexible tool, and there are different types available including Standard KFI (most powerful and flexible), Variable Position (easiest) and XML (good for imports from other programs where an xml file can be created). This article will provide steps to use the easiest template, Variable Position KFI. You can get this template from any data entry screen in Attaché. In this article, customer invoices will be used as it is a common request.

See how to Import customer invoices using Keystroke File Import (KFI) in the sections below including:

  • Getting a Template File.

  • Customising your template.

  • Creating the KFI file.

  • Importing the KFI file.


Get a Template File

A template for any screen can be obtained. To ensure a standardised approach, this article will use an ADI (Attaché Data Import) Invoice screen. To get a template:

  1. Go to Tools, ADI, Load Customers, Invoices.

  2. Enter the customer code of any customer at Customer Details.

  3. Page Down to the first line.

  4. Use Section F4 to change the first line to any line type that you will need in your import, one after the other, there is no need to enter any data.

    • This loads the fields for each line type into the KFI export function in the following steps.

  5. Select the KFI button on the button bar or CTRL plus F9 together as a keyboard shortcut.

  6. In the Keystroke File Import window, select Export F11.

  7. Select Comma-separated values (*.csv) as the Save as type.

    • If you select XML KFI(*.kfi) the template for an XML KFI will be exported.

  8. Give the file a name in place of the asterix.

  9. Close the KFI window and cancel the ADI invoice.

  10. Open the csv file in Excel.


In the csv file you exported:

  • it contains two rows, the first containing an Object_ID and the second containing some coding and lots of field names.

  • Don't change the Object_ID line, it identifies the screen the KFI Template was exported from.

  • Some fields in the second row contain words enclosed in "<" and ">". These are either commands to Attaché KFI or identify screen sections, eg:

    • <HEADROW> - means row 2 in the csv and tells Attaché this is the row where columns of data can be identified.

    • <header> - means the heading within the screen, where the customer code, etc is usually found.

    • <productline> - fields relating to a Product Line up until the next section marker.

    • <sundryline> - fields relating to a Sundry Line up until the next section marker.

    • <paymentline> - fields relating to a Payment Line up until the next section marker.

    • <ENDHEADROW> - Marks the point at which Attaché will stop searching for column identification.

  • words not enclosed in "<" and ">" identify field names for data, eg: customercode; invoicenumber; etc.

Notes:

  • Each row after the HEADROW in the template is ONE invoice.

  • In this article a row in the template is referred to as a 'data row' whereas a "line" refers to a detail line on the imported invoice.

  • Using the above exported template, you can customise your own template by editing the exported file. For example, you can add more lines to each invoice, of different line types (services, comments, etc.), if you require. To customise a template, refer to the customise section below.


Customising your template

You can customise the fields that you want in your template, you don't have to enter data in all fields, and in fact most fields can be deleted so that you keep only the fields you want to complete in your template. However note that some fields are required, just as they are when you enter the customer invoice manually.

For example, you may want to enter the price for a product line rather than allowing the price to come from the Masterfile. You can do this by leaving the price field in the template and ensuring a price is added in that column for all rows after the <HEADROW>.


Create the KFI file

This section assumes you have a spreadsheet or similar containing the data for invoices you want to import.

Creating the KFI file is done in a few steps:

  1. Copy the columns of data from your source data file into the relevant column of your prepared template file.

    • Copy column by column, unless you have ordered the fields in your template to match your source file.

      • you can place the fields for any section in any order.

      • however the header section should come first, then the different lines.

    • For example, copy the whole column of customer codes from your source file to column A, starting at cell A3.

    • Repeat for each of the columns you have left in your template until the <ENDHEADROW> column.

    • Note the Important Notes below relating to format of data.

  2. Once you are happy that the template contains all data to be imported save the Excel workbook as a new csv file with a different name to your template file.

  3. Close the file saved at step 2.

  4. Open the file saved at step 2 in Notepad.

  5. Remove all commas at the end of the Object_ID line.

  6. Save the file again using Notepad.

  7. In Windows File Explorer copy the file and change the extension from csv to kfi.

📌 Notes:

  • Dates should be formatted according to your Attaché user settings, so either entering years as 2 or 4 digits with each date being a plain number, eg: for 13th Sept 2040, then: 13092040 for a four digit year.

  • Check your date settings at File, User Preferences.

  • KFIs are comma delimited files. If you have commas in your data, this will break the KFI. So be sure to remove commas.

  • Before running a KFI, you should either archive your company, or test the KFI in a Test or Play company.

    • If the KFI fails, an err file will be saved to the location as your KFI file. Refer to that err file for help on where the error is in your KFI file.

  • When using the template as exported, all invoices should have the same number of lines, and the same line types. You can add more lines by copying the fields for an entire section, however invoices with more lines should be imported separately.


Import the KFI file

Before proceeding: Ensure you have archived OR that you are in a Test Company. Especially if you are importing lots of invoices or are importing using the KFI template for the first time.

To import the invoices in your KFI file to Attaché:

  1. Go to Tools, ADI, Load Customers, Invoices.

  2. Click the KFI button or select File, Keystroke File Import.

  3. The Keystroke File Import window will open, select File (F2).

  4. Browse to and select the KFI file you created from the template in the above section.

  5. Select Start (F5).

  6. If the KFI file fails halfway through, after correcting the issue by referencing the err file to identify the issue, you will need to remove. from the file any lines that successfully imported before starting the import again. Otherwise, the invoices will be duplicated.


Need Assistance?

Access Attaché Support can assist you with specific queries related to:

  • Using the above template.

  • Importing the template into Attaché.

  • Adjusting fields on the template.

However beyond that, for example, if you need the kfi file prepared for you, we will need to escalate your case to our Consulting Team as a chargeable service.

If you need assistance from Support please raise a new case online and reference the title of this article. If your query becomes a consulting query, we will inform you before escalating your case.

We understand your requirements may not be as simple as this article. Or perhaps you would prefer a more automated solution. If you would like to discuss your requirements, please contact our Consulting Team by emailing [email protected]. Please note after the initial discussion, creating a custom solution is a chargeable service.

Did this answer your question?