Business Integration Solutions Documentation

Walkthrough: EDI Contract Between Two Companies

About this walkthrough

This walkthrough provides an overview on how to establish EDI connection between two companies.

Prerequisites

Template Description Type Company
TI_EDI_1.PO.OUT STAEDEAN Template-Export Purchase Order Outbound CRONUS Sales
TI_EDI_2.SO.IN STAEDEAN Template-Import Sales Order Inbound CRONUS International Ltd.
TI_EDI_3.CONF.OUT STAEDEAN Template-Export Order Confirmation Outbound CRONUS International Ltd.
TI_EDI_4.CONF.IN STAEDEAN Template-Import Order Confirmation Inbound CRONUS Sales
TI_EDI_5.SHIP.OUT STAEDEAN Template-Export Posted Sales Shipment Outbound CRONUS International Ltd.
TI_EDI_6.SHIP.IN STAEDEAN Template-Import Shipment Inbound CRONUS Sales
TI_EDI_7.INV.OUT STAEDEAN Template-Export Posted Sales Invoice Outbound CRONUS International Ltd.
TI_EDI_8.INV.IN STAEDEAN Template-Import Invoice Inbound CRONUS Sales
  1. You can choose to create two companies for demonstration purpose. The templates for EDI Studio can be used for an intercompany integration between:
  • A Sales Company [CRONUS Sales]
  • A HQ Company [CRONUS International Ltd.]
  1. Import the EDI configuration packages from the TI.Templates folder in software package into respective companies as mentioned in the overview section.
  2. Make sure that the user has necessary read and write permissions to the folder which is being used for the File Writer and File Reader Endpoints.
  3. For demonstration purpose, we have created certain custom connectors. You can import TI_EDI_Demo.fob objects containing custom codeunits, available in the Sample.Files folder in software release package. These objects are NOT provided with the standard installation and is strictly for demonstration purpose only. You can create and use custom connectors catering to your needs. For more information on how to create custom connectors, please refer to the Software Development Kit (SDK.pdf) available in the software release package.
  4. A new vendor must be created for the HQ Company.
  5. A new customer must be created for the Sales Company.

An EDI Contract is created between these two companies as shown in the image below:

EDI Steps

Template 1: Purchase Order Export

Story

  • This connection uses the Record Change Event and is linked to an internal document with only one field, the Status field of the Purchase Header table.
  • The filter is set to Released. This means, that when a Purchase Order is released, the Pipeline gets triggered.
  • The Connection contains a Splitter Activity, which results in one message for each posted Purchase Order. The XML-files are exported by the File Writer Endpoint.
  • Two documents are used in this connection:
    • TI_EDI1_PO.TRIG is used for triggering purpose, i.e. the Record Change Event will detect modification based on the table and field structure specified in this document.
    • TI_EDI1_PO.INT is used to generate a filtered set of data, used by XML Generator and Splitter.

EDI Templ1 Pipeline

Setup

  1. Select the CRONUS Sales company.
  2. Import the EDI Connection-TI_EDI_1.PO.OUT.zip configuration package.
  3. Open the TI_EDI_1.PO.OUT connection.
  4. Edit RECORDCHANGEEVENT and specify the following fields. EDI Templ1 Settings1
  5. Edit XMLGENERATOR and specify the following fields EDI Templ1 Settings2
  6. Edit SPLITTER and specify the following fields EDI Templ1 Settings3
  7. Edit FILEWRITER and specify the following fields EDI Templ1 Settings4
  8. Run the Check Configuration action to see if the connection is configured properly.
  9. Publish the connection (optional for demo purpose). Follow the steps in the wizard to complete the publication.
  10. Refresh or restart Business Central client.

Process

  1. Create two new purchase orders, say for vendor 10000 London Postmaster and 20000 AR Day Property Management.
  2. Release both Purchase Orders.
  3. Process the connection.

Result

EDI Templ1 Result

For each Released Purchase Order, an XML-file is created and available on the specified location.

Template 2: Sales Order Import

Story

  • This Connection uses the File Reader Endpoint to read the Purchase Order (in XML-format) from the file system.
  • The Purchase Order XML-file has to be imported as a Sales Order, so it does not compare to the NAV table structures for the Sales Header table.
  • A Mapper Activity is used to map the External (Source) document and the Internal (Target) document.
  • The Record Generator Activity creates records and updates the NAV tables.
  • Two documents are used in this connection:
    • TI_EDI2_SO.EXT corresponds to the external document which is being read.
    • TI_EDI2_SO_INT corresponds to the internal NAV table structure specifying how the records will be stored.

EDI Templ2 Pipeline

Setup

  1. Select the CRONUS International Ltd. company.
  2. Import the EDI Connection-TI_EDI_2.SO.IN.zip configuration package.
  3. Open the TI_EDI_2.SO.IN connection.
  4. Edit FILEREADER and specify the following fields. EDI Templ2 Settings1
  5. Edit MAPPER and specify the following fields. EDI Templ2 Settings2

EDI Templ2 Settings4 6. Edit RECORDGENERATOR and specify the following fields. EDI Templ2 Settings3

Process

  1. Process the connection.
  2. If processed successfully, check Message Entries for results.

Result

A new Sales Order is created and available at the Sales Header table. The Message Entries table shows you which Sales Order is created. Use the Transaction Log to see more details for each import.

EDI Templ2 Results

Template 3: Order Confirmation Out

Story

  • The Sales Order is imported with the status Open.
  • After the Sales Manager confirms (or changes) the Planned Shipment Dates, he will set the status to Released.
  • This is the trigger for this EDI Connection. Based on a Record Change Event, a new Export is created.
  • Two documents are used in this connection:
    • TI_EDI3_SO.TRIG is used for triggering purpose, i.e. the Record Change Event will detect modification based on the table and field structure specified in this document.
    • TI_EDI3_SO.INT is used to generate a filtered set of data, used by XML Generator and Splitter.

EDi Template Out

Setup

  1. Select the CRONUS International Ltd. company.

  2. Import the EDI Connection-TI_EDI_3.CONF.OUT.zip configuration package.

  3. Open the TI_EDI_3.CONF.OUT connection.

  4. Edit RECORDCHANGEEVENT and specify the following fields Edit XMLGENERATOR and specify the following fields. EDI Templ3 Settings1

  5. Edit XMLGENERATOR and specify the following fields. ![EDI Templ3 Settings2](Images/DM_EDI_Tmpl3_Setting2.png)
  6. Edit SPLITTER and specify the following fields. EDI Templ3 Settings3

  7. Edit FILEWRITER and specify the following fields. EDI Templ3 Settings4

  8. Run the Check Configuration action to see if the connection is configured properly.

  9. Publish the connection (optional for demo purpose). Follow the steps in the wizard to complete the publication.

  10. Refresh or restart Business Central client.

Process

  1. Release the Sales Orders imported previously.
  2. Process the connection.

Result

For each Released Sales Order, an XML-file is created and available on the specified location.

EDI Templ3 Results

Template 4: Order Confirmation In

Story

  • This Connection uses the File Reader Endpoint to read the Order Confirmation (in XML-format) from the file system.
  • The Sales Order Confirmation does not compare to the NAV table structures for the Purchase Header table.
  • A Mapper Activity is used to map the External (Source) document and the Internal (Target) document.
  • The Record Generator Activity creates records and updates the NAV tables.
  • After importing the Order Confirmation, the External Document No. is updated on the Purchase Header.
  • Two documents are used in this connection:
    • TI_EDI4_SO.EXT corresponds to the external document which is being read.
    • TI_EDI4_SO.INT corresponds to the internal NAV table structure specifying how the records will be stored.

EDi Template In

Setup

  1. Select the CRONUS Sales company.
  2. Import the EDI Connection-TI_EDI_4.CONF.IN.zip configuration package.
  3. Open the TI_EDI_4.CONF.IN connection.
  4. Edit FILEREADER and specify the following fields. EDI Templ4 Settings1
  5. Edit MAPPER and specify the following fields. EDI Templ4 Settings2
  6. Edit RECORDGENERATOR and specify the following fields. EDI Templ4 Settings3
  7. Edit EVENTGENERATOR and specify the following fields. EDI Templ4 Settings4

Process

  1. Process the connection.
  2. If processed successfully, check Message Entries for results.

Result

EDI Templ4 Results

The Purchase Order is now updated with the External Document No. field. Use the Transaction Log to see more details for each import.

Template 5: Shipment Out

Use this connection to export Shipment from the CRONUS International Ltd.

Story

  • After the Sales Manager Posts (by pressing Post, select Ship, NOT Invoice or Ship and Invoice, press Ok) a Posted Sales Shipment is created for this Sales Order.
  • This is the trigger for this EDI Connection. Based on a Record Change Event, a new Export is created.
  • The TI_EDI5_SHIP.INT document is used to trigger the pipeline and also to generate filter set of data for XML Generator and Splitter.

EDI Templ5 Pipeline

Setup

  1. Select the CRONUS International Ltd. company.
  2. Import the EDI Connection-TI_EDI_5.SHIP.OUT.zip configuration package.
  3. Open the TI_EDI_5.SHIP.OUT connection.
  4. Edit RECORDCHANGEEVENT and specify the following fields. EDI Templ5 Settings1
  5. Edit XMLGENERATOR and specify the following fields. EDI Templ5 Settings2
  6. Edit SPLITTER and specify the following fields. EDI Templ5 Settings3
  7. Edit FILEWRITER and specify the following fields. EDI Templ5 Settings4
  8. Refresh or restart Business Central client.

Process

  1. Open a Released Sales Order, define the Quantity to Ship field on the Sales Line.
  2. Post Shipment.
  3. Process the connection.

Result

EDI Templ5 Results

For each Shipped Sales Order, an XML-file is created (based on the Posted Sales Shipment) and available on the specified location.

Template 6: Shipment In

Use this connection to import Shipment into the CRONUS Sales.

Story

  • This Connection uses the File Reader Endpoint to read the Posted Sales Shipment (in XML-format) from the file system.
  • The Posted Sales Shipment does not compare to the NAV table structures for the Purchase Header table.
  • A Mapper Activity is used to map the External (Source) document and the Internal (Target) document.
  • The Record Generator Activity creates records and updates the NAV tables.
  • After importing the Posted Sales Shipment, the Quantity to Receive and the Vendor Shipment No. are updated in the Purchase Order.
  • Two documents are used in this connection:
    • TI_EDI6_SHIP.EXT corresponds to the external document which is being read.
    • TI_EDI6_SHIP.INT corresponds to the internal NAV table structure specifying how the records will be stored.

EDi Template In

Setup

  1. Select the CRONUS Sales company.
  2. Import the EDI Connection-TI_EDI_6.SHIP.IN.zip configuration package.
  3. Open the TI_EDI_6.SHIP.IN connection.
  4. Edit FILEREADER and specify the following fields. EDI Templ6 Settings1
  5. Edit MAPPER and specify the following fields. EDI Templ6 Settings2
  6. Edit RECORDGENERATOR and specify the following fields. EDI Templ6 Settings3
  7. Edit EVENTGENERATOR and specify the following fields. EDI Templ6 Settings4

Process

  1. Process the connection.
  2. If processed successfully, check Message Entries for results.

Result

EDI Templ6 Results

The Purchase Order is now updated with the Quantity to Receive and the Vendor Shipment No. fields. Use the Transaction Log to see more details for each import.

Template 7: Invoice Out

Use this connection to export Invoice from the CRONUS International Ltd.

Story

  • The Sales Order is now ready to be invoiced.
  • After the Sales Manager Posts an invoice, a Posted Sales Invoice is created for the Sales Order. This is the trigger for this EDI Connection.Based on a Record Change Event, a new Export is created.
  • The TI_EDI7_INV.INT document is used to trigger the pipeline and also to generate filter set of data for XML Generator and Splitter.

EDi Template Out

Setup

  1. Select the CRONUS International Ltd. company.
  2. Import the EDI Connection-TI_EDI_7.INV.OUT.zip configuration package.
  3. Open the TI_EDI_7.INV.OUT connection.
  4. Edit RECORDCHANGEEVENT and specify the following fields. EDI Templ7 Settings1
  5. Edit XMLGENERATOR and specify the following fields. EDI Templ7 Settings2
  6. Edit SPLITTER and specify the following fields. EDI Templ7 Settings3
  7. Edit FILEWRITER and specify the following fields. EDI Templ7 Settings4
  8. Refresh or restart Business Central client.

Process

  1. Open a Released Sales Order, define the Quantity to Invoice field on the Sales Line.
  2. Post Invoice.
  3. Process the connection.

Result

EDI Templ7 Results

For each Invoiced Sales Order, an XML-file is created (based on the Posted Sales Invoice) and available on the specified location.

Template 8: Invoice In

Use this connection to import Invoice into the CRONUS Sales.

Story

  • This Connection uses the File Reader Endpoint to read the Posted Sales Invoice (in XML-format) from the file system.
  • The Posted Sales Invoice does not compare to the NAV table Structures for the Purchase Header table.
  • A Mapper Activity is used to map the External (Source) document and the Internal (Target) document.
  • The Record Generator Activity creates records and updates the NAV tables.
  • After importing the Posted Sales Invoice, the Quantity to Invoice and the Vendor Invoice No. are updated on the Purchase Order Card.
  • Two documents are used in this connection:
    • TI_EDI8_INV.EXT corresponds to the external document which is being read.
    • TI_EDI8_INV.INT corresponds to the internal NAV table structure specifying how the records will be stored.

EDi Template In

Setup

  1. Select the CRONUS Sales company.
  2. Import the EDI Connection-TI_EDI_8.INV.IN.zip configuration package.
  3. Open the TI_EDI_8.INV.IN connection.
  4. Edit FILEREADER and specify the following fields. EDI Templ8 Settings1
  5. Edit MAPPER and specify the following fields. EDI Templ8 Settings2
  6. Edit RECORDGENERATOR and specify the following fields. EDI Templ8 Settings3
  7. Edit EVENTGENERATOR and specify the following fields. EDI Templ8 Settings4

Process

  1. Process the connection.
  2. If processed successfully, check Message Entries for results.

Result

EDI Templ8 Results

The Purchase Order is now updated with the Quantity to Invoice and the Vendor Invoice No. fields. Use the Transaction Log to see more details for each import.