You’ll need to set up a few things in Wiise before you can import a purchase document. Before you get started, here’s an overview of the steps.
- Create the data exchange definition and data exchange type. This is how Wiise imports data, like vendors and items, from an external purchase document, and converts them into a Wiise document.
- Set up line and column definitions. Set these up so Wiise knows where to map the imported data and what format it’s in.
- Map purchase lines and header lines. This is how you map the data from the columns in each line in the file to the matching fields within Wiise.
- Add a data exchange type. Other people can use this data exchange type without having to re-do the data exchange definition.
- Import CSV purchase documents. You can do this manually if you want to import a specific document.
The first step is to define the data exchange definition. This is how you import data from external documents (such as purchase orders or invoices) into Wiise. The data, such as items and vendors, must already be set up in Wiise.
When you create the data exchange definition, you set up the file format (CSV or XML) that’ll be imported. And you set up how the data from the files are mapped to Wiise fields. The data exchange definition is assigned a data exchange type — this is used to convert the incoming document to the related purchase document into Wiise.
This example is for a purchase invoice document:
- Search for and select Data Exchange Definitions – Lists, then select +New
- Include the data exchange definition Code — in this case it’s PURCHASE INVOICE CSV
- Include a data exchange definition Name, for example: Purchase Invoice
- Set File Type to Variable Text, and Type to Generic Import
- To include the codeunits that will prompt the import, select Show more
- In Data Handling Codeunit, select 1214
- In Reading/Writing Codeunit, select 16034400
- In Header Lines, enter 1 to show that the first line in the file consists of header data. This will be left out of the import.
You’ll then need to set up line definitions. A line definition is simply a row of data fields in your CSV file. This is how you set up the fields from the CSV file so they can map to documents in Wiise.
Here’s how to set up Line Definitions for vendor details like name and address (the header), and the items ordered or purchased (the lines):
- In the first line of the Line Definitions section, change LINE TYPE to Header, change CODE to HEADER, and then enter a Name.
- In the second line, change LINE TYPE to Detail, change CODE to LINES, and enter a Name.
- On the second line, set the PARENT CODE to HEADER.
Next, you’ll need to set up column definitions. These are simply the data types in the header and line fields in the CSV file. This is how Wiise automatically adds data from the CSV file to your purchase orders or invoices.
To add Column Definitions for the header and lines from your Line Definitions, follow these steps:
- Highlight the HEADER or LINES in the Lines Definition section.
- In the Column Definitions section, add the information for each of the columns in your CSV file:
- COLUMN NO. (will be the same as the column number in the CSV file)
- NAME of the column
- DATA TYPE (Text, Decimal, Date or DateTime)
- DATE FORMAT (such as dd/MM/yyyy) .
- Set up the language you’ll use in DATA FORMATTING CULTURE, for example: en-AU for Australian.
- Do this first for the HEADER and when you’ve finished, you can repeat the steps for the LINES.
Note: This data import supports field mapping to both Global and Shortcut Dimensions.
How to set up other required fields
You might need extra information that’s not included in your CSV file, like whether the document is an order or an invoice. This information can be set up in column definitions as a CONSTANT.
- Include a COLUMN NO. that’s not within the CSV file, such as 999.
- And include a CONSTANT to ensure it’s captured (the number 3 is used in this example to identify the document type of invoice).
Now you're ready to map, or cross reference, your data. In this step you'll be mapping the columns and lines to the matching fields in Wiise. And you’ll be using the definitions you've just set up.
You’ll need to complete this twice. Once for the HEADER to map fields to a vendor. And once for the LINES, to the lines of an order, invoice or quote.
How to map purchase headers
- Highlight the first line definition (HEADER). Select Manage on the Line Definitions ribbon, then select Field Mapping.
- Select + to create new entry and then in the General section, set up the mapping like this:
- In Table ID, select 1214
- Tick Use as Intermediate Table
- In Name, type Purchase Header
- Leave both Pre-Mapping Code and Post-Mapping Code blank
- In Mapping Codeunit, select 16034408 (this is for purchase documents)
- In the Field Mapping section, set up which columns map to which fields within Wiise:
- Select the COLUMN NO. from the list of columns created in the How to set up column definitions steps above
- Set the TARGET TABLE ID — this is 38 for purchase header.
- Then finally, in the TARGET FIELD ID, select the Wiise field you want to import to.
- When you’re done, select the back arrow on the top left of the Field Mapping page to exit.
Note: This data import supports field mapping to both Global and Shortcut Dimensions.
How to map purchase lines
- Highlight the next line definition (LINES). Then select Manage on the Line Definitions ribbon, and select Field Mapping.
- Select + to create new entry and then in the General section, set up the mapping like this:
- In Table ID, select 1214
- Tick Use as Intermediate Table
- In Name, enter Purchase Line
- Leave both Pre-Mapping Code and Post-Mapping Code blank
- In Mapping Codeunit, select 16034408 (this is for purchase documents)
- In the Field Mapping section, specify which columns map to which fields within Wiise.
- Select the COLUMN NO. created in the How to set up column definitions steps above
- Set the TARGET TABLE ID — this is 39 for purchase line.
- Finally, in the TARGET FIELD ID, select the Wiise field you want to import to.
- When you’re done, select the back arrow on the top left of the Field Mapping page to exit.
Note: This data import supports field mapping to both Global and Shortcut Dimensions.
If you want to import a file with four dimensions, for example, you’d set up four individual column definition lines. You can import up to eight dimension fields including:
- A maximum of two global dimensions — these are used as filters on reports and batch jobs. Choose dimensions you’ll use often.
- A maximum of six shortcut dimensions — these are found as fields on journal and document lines.
After you’ve completed the data exchange definition and field mapping, you’ll need to add a data exchange type. This is how you identify the data exchange definition you’ve set up. When you import your CSV file, you’ll be prompted to choose a data exchange type.
Other people in your business can then import purchase orders or invoices using the data exchange types you’ve set up.
- Search data exchange types and select Data Exchange Types — Administration.
- Select + to create a new line and fill in the fields on the line like this:
- CODE = PURCHCSV
- DECSRIPTION = Purchase invoice CSV
- DATA EXCH. DEF CODE = PURCHASE INVOICE CSV
To import CSV files manually, follow these steps:
- First, choose an Incoming Document:
- Search for and select Incoming Document
- Select Create from File in the New ribbon tab
- Browse your files to locate and select the CSV file.
- Now select the appropriate Data Exchange Type:
- Open the newly chosen incoming document
- Under the General section, select the appropriate the Data Exchange Type.
- On the ribbon, select Process > Select Document Type and Create
- If there’s a permission error, field mismatch or any other error, you’ll see an Errors and Warnings message.
- If you have to change the setup or data, for example, make the correction and then start Step 3 again.
- If the issue is with the CSV file, you’ll need to correct the error and then start the process again from Step 1.
- If the import is successful, you’ll see the incoming document Status will be Created, and the document number will be shown in the Record field.