
With the order field links you can control the way documents are automatically generated. You can link order-fields with document fields, so that when a document is generated, the value of the order field is retrieved and inserted in the document field.
Follow these steps to add order field links to a document field:
- Click Windows -> Documenttypes
- Select the documenttype you want to edit, and click "Edit"
- Select the "Fields" tabpage
- Select the field you want to edit, and click "Edit"
- Select the last tab "Order field links"
- Select the order field you want to link with this document field, and click "Insert"
- You can repeat the previous step, and add multiple fields, until all necessary fields are added
- Click "Save and close"

Example 1
Suppose the documenttype "CMR-NL" contains a field with the title "Instructions Sender". Suppose orders also contain a field "Instructions Sender".
You then can add the following 'order field link' to the 'Instructions Sender' field of docmenttype 'CMR-NL':
[Order~InstructionsSender] (select the field in the list and click 'insert')
If you now want to auto-generate the "CMR-NL" document, first fill in or import an order. Select the order, and click "Generated document -> CMR-NL". A new document will be created, and for each field, the order field links will be checked. If a valid link exists, the value will be retrieved from the order, and inserted in the document field.
Example 2
Suppose the "CMR-NL" documenttype contains a field "Consignee". Suppose orders also contain a field, named "Consignee".
In the order field links of the documenttype field you can then input:
[Contact~Consignee~Company~CompanyName] [Contact~Consignee~Company~Street] [Contact~Consignee~Company~Number] [Contact~Consignee~Company~Bus] [Contact~Consignee~Company~PostalCode] [Contact~Consignee~Company~Place] [Contact~Consignee~Company~Country]
If you now want to automatically generate this document, first import or fill in an order. Next, select the order, and click "Generate document -> CMR-NL". A new document will be created. If the order has a consignee assigned, the consignee field will be filled with the following results :
XYZ Logistics Mainstreet 10 1234 ChurchPlace Belgium
Adding extra text and calculating numeric values
Next to the different orderfields you can select, it's also possible to input regular text, and make use of mathematical operators (+ - * /).
- Adding extra text
You can input your own text in the order field links. Orderfields are written between square brackets ([]). Those orderfields will be replaced by the order field value. The other text in the field will remain unchanged.
For example: "To: [Contact~Consignee~Company~CompanyName]" will result in: "To: XYZ Logistics"
- Adding, subtracting, multiplying and dividing numerical values
Fields that contain numerical values, can be added, subtracted, multiplied or divided. Write the wanted operator between square brackets.
For example: "[Product~ProductCount][*][Product~NettoWeight] kg" will result in: "20 kg" (40 * 0,5 kg)
Important remarks:
When you add a product field, eg. [Product~Name], and the order contains multiple products, each product will be inserted on a new line. This can produce unexpected results : Suppose the documenttype "CMR-NL" contains a field "ProductList". Suppose you have added the following order field links to that field: [Product~Name] [Product~ProductCount]
Result for an order with 1 product: (correct) Testproduct1 12
Result for an order with 2 products: (wrong!) Testproduct1 Testproduct2 12 24
What happened? [Product~Name] in our example got replaced by 2 lines with the productnames. [Product~ProductCount] got replaced with 2 lines with the productcounts. (12 & 24)
Solution:
You have to split the "Productlist" field of the "CMR-NL" documenttype in 2 separate fields (2 columns). In the first field, you place the order field link "[Product~Name]". In the second field, place the link "[Product~ProductCount]"
Result:
Testproduct1 12 Testproduct2 24
also see: Tabpage "Auto-generate options"
|