To each document, add the data records to be exchanged. For external file-based documents, set up the records in line with how the data is structured and named in the file.

This topic explains how to add records to a Microsoft Word document.


Standard procedure

1. Click Connectivity studio Integration Design.
2. Click the Documents tab.
3. In the list, find and select the desired Microsoft Word document.
4. Click Edit.
5. In the Record section, click Add line.
6. As a record name, enter a free-definable name. Usually, this is the name used in the external file.
  In the Record field, type a value.
7. Because in D365 FO the data is structured in records and fields, for each external document type, the data structure is translated in the same way. To do this, by default the table 'BisBuffertable' is used. The values are stored in a container field in this table. As a consequence, you can add or remove fields without coding to avoid deployment issues.
  In the Record table field, keep the default value 'BisBufferTable'.
8. Use the parent record to define a record structure with parent-child relations.
  In the Parent record field, enter or select a value.
9. By default, if you have a parent-child relation, the parent and child data is processed separately. You can process the parent and child data together.
  Select Yes in the Combine with parent record field.
10. This setting is only applicable to parent records.
- Inner join: To process the parent record, the child record must exist. Example: A sales order is only processed if it has a sales line. If no sales line exists, the sales order is not processed. If a sales line exists, both the sales order and the sales line are processed.
- Outer join: To process the parent record, it is not required that child a record exists. Example: A sales order with no sales lines is processed.
- Exists join: To process the parent record, a child record must exist. Example: If sales order has a sales line, only the sales order is processed. If the sales order does not have a sales line, the sales order is not processed.
- NoExistsJoin: Only parent records are processed that do no have child records. Example: A sales order is only processed if it does not have a sales line.
  In the Join mode field, select an option.
11. During an import or export you can have the need to update another table in D365 FO. Usually, this is an internal history table to trace what is imported or exported.
If you select Yes:
- The record is skipped by the query. And therefore, not exported to an external format.
- You can use the record in the message mapping.
- The record uses the validations as defined in D365 FO.
  Select Yes in the History field.
12. Sub-task: Set record details.
  12.1 In the Line details section, define the detailed settings for the record.
You can write records to Microsoft Word in these ways:
- Fields: Replace the markers in the template text with the field values. The markers, as defined for the fields, are used to add the field values to the document.
- Paragraph: Add the record field values to the document in paragraph style. First the field label is added and second the field value is added. The marker defines the paragraph position in the document.
- Table: Add the records in a table layout using the table style from the template. The first column has the field labels and the second column has the field values. The marker defines the table position in the document.
  In the Type field, select an option.
 

Note: If the type is:
- Fields, none of the other Word-document-specific settings in the Line details section are applicable:
- Paragraph, also fill in these fields in the Line details section: Marker type, Marker, Title option, Title field, Title style, Break before, and Break after. Use these field settings to define the paragraph layout: Break before, Custom separator before, Break after, Custom separator after, Title field.
- Table, also fill in these fields in the Line details section: Marker type, Marker, Table style, Title option, Title field, Title style, and Break before.

  12.2 You can define if a line or page break must be applied before a paragraph or table is inserted in the Word document. So, the Break before only applies if the Type is Paragraph or Table.
  In the Break before field, select an option.
  12.3 You can define if a line or page break must be applied after a paragraph that is inserted in the Word document. So, the Break after only applies if the Type is Paragraph.
  In the Break after field, select an option.
  12.4 Define the table style to be applied to the record table. Select a style as defined in the template. So, the Table style only if the Type is Table.
  In the Table style field, enter or select a value.
  12.5 Indicate if the field names are added as header to the table. So, the Table option only applies if the Type is Table.
  In the Title option field, select an option.
  12.6 Define the field that is used as a title for the paragraph. The title field is placed at the start of a record. So, the Title field only applies if the Type is Paragraph.
  In the Title field field, enter or select a value.
  12.7 Define the style to be applied to the title field. Select a style as defined in the template. So, the Title style only applies if the Type is Paragraph.
  In the Title style field, enter or select a value.
  12.8 Define the type of marker that is used to indicate the position where the table or paragraph must be added to the document. So, the Marker type only applies if the Type is Paragraph or Table.
  In the Marker type field, select an option.
  12.9 Define the marker that is used to indicate the position where the table or paragraph must be added to the document. When writing data to the document, the marker is replaced by the table or paragraph. So, the Marker only applies if the Type is Paragraph or Table.
If the marker type is:
- Text, enter the text marker that is used in the template. You are advised to use a name between brackets, for example, [RecordName]. Use the full marker, including the brackets, both in the template and here.
- Bookmark, enter the bookmark name as defined in the template. In the template, the bookmark name is preceded by a hashtag (#). In this field, only enter the marker name, without the hashtag.
  In the Marker field, type a value.
13. Close the page.

Notes

Generic external document record details fields:

  • External reference: You can indicate which field of the record contains the unique ID of the record in the external database. In this way, you link the external ID to the D365 FO record ID. Note: Usually, you only use this for an ODBC connection with CRM or if you use web services.
  • Revision field: You can indicate which of the records fields contains the revision of the record in the external database. In this way, you find and link the latest revision to the record ID. Note: You can only use this field in combination with the External reference field.

See also

Provide feedback