When you import data, it can be required to report the success or failure of the import to the source.

You report the import status to the source in several ways. Which way to choose, depends on the import scenario:
  • Import from an external database.
  • Import from file.

Import from external database

You can import data from an external database. If the root record of the external database has a field that represents the record status, you can report the import status to the external database.
 
To report a status to the source on import from an external database, you need a:
  • Source
  • Target
  • Message

Source

The source document must be of type ODBC and the source connector must be of type Database.
The source document records must be in line with how the data is structured and named in the external database.
On the source document, make sure the record status field of the external database is added to the root record.

Target

The target document must be an internal document and the source connector must be of type D365 FO.

Message

On the message header, define the Update source status settings:
  • Status field field, indicate which of the root record fields represents the record status.
  • Processed status field, enter the status that is assigned to the external database record if the message is successfully processed. Make sure, the processed status exactly matches the related status in the external database.
  • Error status field, enter the status that is assigned to the external database record if errors occurred on processing the message. Make sure, the error status exactly matches the related status in the external database.
Example:

Import from file

You can import data from files. To do so, the source document must be an external file-based document and the source connector must be a Windows folder connector.
If you import data from a file, you can report the import status to the source using a file. So, you need a message to import the data and a message to report the import status to the external source.
For example, import an item from an external system and report the import status to the external system.

Import item

To import, for example, an item, you need a:
  • Source document
  • Target document
  • Message

Source document

The source document is an external file-based document with the records and fields that define the item data in the file.

Target document

The target document is a D365 FO document with the records and fields to import the item data into D365 FO.

Message

The message maps the records and fields of the source document and target document. In the example, this message is called 'Import item'.
On the message header, define these history settings:

Export status

To export the status of the import, for example an item import, you need a:
  • Source document
  • Target document
  • Message
  • Data synchronization

Source document

To the source document, add these records:
  • BisHistory with these settings:
    • Fields:
    • Range: Add these ranges:
      • Name: [import message name]. So, only the history for that message is considered.
      • Status: Finished,HasError. So, only the fully processed history records are considered.
        Example:
  • BisHistoryEntity with these settings:
    • Fields:
    • Relation:
  • BisBufferTable with these settings:
    • Fields:
    • Relation:

Target document

To the target document, add a record to define the item status in the file.
Example:

Message

On the message, map record 'ItemStatus' to 'BisBufferTable', and map these fields:

For the 'status' fields, select the Constant check box and fill in the Constant name with the success or error status name of the external system. For example: 'OK' and 'Error'.
To each status field, add a field condition:
  • 'OK' status field:
  • 'Error' status field:

Data synchronization

On the message header, set up this data synchronization and create the SQL trigger if it does not exist:

Provide feedback