Skip to main content

Inbound Messages

Inbound messages are those sent to Business Central from an external system, typically triggered by the external system.

Inbound Integration Handlers

Inbound integration handlers are created for every expected inbound message from an external system. Each handler defines:

  • Message Type and Source: EDI Partner, etc.
  • Data Import Method: See below for details.
  • Main Table: The message is based on this.
  • Partner Reference: e.g., External Document No.
  • Processing Time: Choose immediate (synchronous) or background (asynchronous) processing.

Import Methods

The Import Method specifies how to process the payload in the integration message. The app supports:

  • Data Exchange
  • XML Port
  • Codeunit

Data Exchange

This is the most common method, allowing you to map integration messages using configuration in the form of data exchange definitions. Supported formats include XML, JSON, and variable text files.

note

Fixed text is not supported by default.

Data Exchange Definition Setup

Below are recommended settings for data exchange definitions for importing messages.

File TypeTypeData Handling CodeunitReading / Writing XMLportUser Feedback CodeunitExt. Data Handling CodeunitFile Encoding  Column Separator
XMLGeneric Import70254543120370254544
JsonGeneric Import702545437025457870254544
CSVGeneric Import702545431220702545441240UTF-8/UTF-16Comma

Data Exchange Definitions and Excel Importer

If you have our Excel Importer app, connect the data exchange definition to an Excel Importer Import Definition. Excel Importer processes both Excel files and variable/fixed text files. Consider using Excel Importer because:

  • You want to import fixed text files (which are unsupported by Data Exchange).
  • You prefer importing Excel files directly rather than converting them to text.
  • You want to leverage Excel Importer's mapping and transformation features.
  • You need to skip specific records in the text file.
  • Your text file contains multiple record types (e.g. header and line), and you require values from both during processing.
  • You desire additional Excel Importer features (e.g. Importing and Posting Journals).

Example: Using Excel Importer with Integration Hub

Inbound Integration Handler

Select Data Exchange for the Import Methodon the Integration Handler.

Inbound Integration Handler

Data Exchange Definition

Select Process using Excel Importer for the Type. When you select this, you will notice that most fields will be hidden on the Data Exchange Definition page, and the Import Definition field will become available.

Data Exchange Definition

Excel Importer - Import Definition

This Import Definition is linked to a Sales Document import.

Import Definition

Excel Importer - Mapping Template

The Mapping Template is defined for a variable text file separated by commas.

Import Definition

XML Port

Create an XML Port for messages with high volumes of records (thousands of rows). Though AL development is required, it is more efficient.

Codeunit

This method uses a custom Codeunit to execute specific logic related to the received message, requiring custom development.

Testing Inbound Integration Handlers

Select "Import and Process Message". This will:

  • Create an integration event entry and prompt you to select a file
  • Trigger the integration as if the file was received externally

Processing Integration Messages in the Background

Configure inbound integration messages to be processed in the background, which is ideal for large payloads to avoid timeouts. When a message is set for background processing, it will create an entry in the Integration Job Queue Entry and then complete.

caution

Only message validation occurs in the background. A separate call is required to check the processing status.

Integration Job Queue Entry

AAD Applications users aren't considered licensed and can't create scheduled tasks, impacting integrations needing background processing. To address this:

  • An entry is created in the Integration Job Queue Entry table, mirroring the Job Queue Entry.
  • A job queue entry configured to run Codeunit 70254552 - ProcessIntJQEntries_IH_TSL reads this queue table and creates a Job Queue Entry for background processing.

This setup ensures Job Queue Entry creation by licensed users only. Additional cues on the integration activities page show record statuses.

See Also