In 4.500, the Importer program was modified and the concept of field groups introduced. Read this section if you want to understand about field groups and how to set them up to import data from a file containining lines in multiple formats.
The fields belonging to one field group are always held on one line. They cannot be split over several lines. This means that the maximum number of characters that can be held in a field group is governed by the maximum length of an import line, which is 8190 characters. Each line of the import file may contain more than one field group.
There are two types of field group, called untagged and tagged. The fields in an untagged group are repeated on every line of the import file. The fields in a tagged group are only repeated on certain lines. Field groups are named like this because you do not have to identify or tag field groups that repeat on every line of the import file, but you do have to tag field groups that only occur on certain lines of the import file. A tag is a field in the import file that appears on each line of the import file that holds the field group. Tags are normally numbers at the beginning of the line.
Some examples of import files and the field groups that you would set up to describe their import fields follow:
A comma delimited import file containing lines that are all the same:
<field1>,<field2>,<field3>
<field1>,<field2>,<field3>
...
<field1>,<field2>,<field3>
You do not need to set up a field group in the Importer for the above. If the fields are from the same table, in the Importer just define the table and then that <field1> is in column 1, <field2> in column 2 and <field3> in column 3.
Suppose your import file holds fields from two tables on different lines:
1,<tab1_field1>,<tab1_field2>,<tab1_field3>
1,<tab1_field1>,<tab1_field2>,<tab1_field3>
...
1,<tab1_field1>,<tab1_field2>,<tab1_field3>
2,<tab2_field1>,<tab2_field2>,<tab2_field3>
2,<tab2_field1>,<tab2_field2>,<tab2_field3>
...
2,<tab2_field1>,<tab2_field2>,<tab2_field3>
You need to set up two tagged field groups to import the above:
<tab1_field1>,<tab1_field2>,<tab1_field3>
which appear in columns 2, 3 and 4 on lines tagged by the value 1 in column 1.
One tagged group to import the TAB2 fields:
<tab2_field1>,<tab2_field2>,<tab2_field3>
which appear in columns 2, 3 and 4 on lines tagged by the value 2 in column 1.
Suppose you wanted to import sales order information. The import file might hold ORDER_LINE fields on every line and ORDER_HEADER fields on some lines, for example:
1,<OH_field1>,<OH_field2>,<OL_field1>,<OL_field2>
,,,<OL_field1>,<OL_field2>
,,,<OL_field1>,<OL_field2>
,,,<OL_field1>,<OL_field2>
...
1,<OH_field1>,<OH_field2>,<OL_field1>,<OL_field2>
,,,<OL_field1>,<OL_field2>
,,,<OL_field1>,<OL_field2>
You need to set up two field groups to import the above: a tagged group to import the ORDER_HEADER fields:
<OH_field1>,<OH_field2>
which appear in columns 2 and 3, on lines tagged by the value 1 in column 1, and an untagged group to import the ORDER_LINE fields:
<OL_field1>,<OL_field2>
which appear on every line in columns 4 and 5.