Electronic Data Interchange (EDI)

In this article
Product Information
Release Notes

DXC Electronic Data Interchange (EDI) - Technical Guide

The DXC EDI module provides enhanced functionalities to Microsoft Dynamics 365 for Finance and Operations (FinOps). This guide provides an overview of the technical requirements for making extensions to specific features.

Create new document type

  1. Update your model parameters to reference package, DXC EDI
    Note: if working on customizations for any of the following modules, then please select the appropriate reference packages for it
    • DXC EDI 3PL Documents
    • DXC EDI Customer Documents
    • DXC EDI Freight Forwarder Landed Cost Documents
    • DXC EDI Vendor Documents
  2. Add new document type
    • Extend the enum, SAB_EDIDocumentType from the parent module, DXC EDI
    • Add new element for your inbound or outbound document type and provide an appropriate label for it
  3. Create and implement the document type class.

EDI > Setup > Document type

alt text

EDI > Files > Inbound files

alt text

EDI > Files > Inbound files > Upload files

alt text

alt text

Note: If your document type if not visible, navigate to EDI > Setup > EDI parameters > General and run refresh module.

Implement SAB_EDIDocumentTypeClass for EDI documents

Pre-requisites

  1. Create staging data tables for EDI documents
  2. Document settings profile
  3. EDI document processing

Inbound documents

  1. Extend the abstract class SAB_EDIDocumentTypeClass
  2. Add SAB_EDIDocumentTypeFactoryAttribute attribute to the class declaration and pass your SAB_EDIDocumentType enum as value.
    Example: [SAB_EDIDocumentTypeFactoryAttribute(SAB_EDIDocumentType::InboundExample)]
  3. Implement all of the following methods, see the class library for more information.
    • documentDescription
    • documentDirection
    • documentHierarchyPath
    • documentName
    • documentRootNodeName
    • processMenuItem
    • processMenuItemSingle
    • stagingHeaderFromCommon
    • stagingHeaderKeyField
    • stagingHeaderTransferStatusFieldId
    • stagingLineFromCommon
    • tableIdHeader
    • tableIdLine
    • tableIdTradingPartnerDefault

Outbound documents

  1. Extend the abstract class SAB_EDIOutboundDocumentTypeClass
  2. Add SAB_EDIDocumentTypeFactory attribute to the class declaration and pass your SAB_EDIDocumentType enum as value.
    Example: [SAB_EDIDocumentTypeFactory(SAB_EDIDocumentType::InboundExample)]
  3. Implement all of the following methods, see the class library for more information.
    • documentDescription
    • documentHierarchyPath
    • documentName
    • documentRootNodeName
    • stagingHeaderFromCommon
    • stagingHeaderKeyField
    • stagingHeaderTransferStatusFieldId
    • stagingLineFromCommon
    • tableIdHeader
    • tableIdLine
    • tableIdTradingPartnerDefault

Create staging data tables for EDI documents

Header table

  1. Create new table to store your staging header data.
    Example:
    • EDI[Extension][Inbound]HeaderStaging
    • EDI[Extension][Outbound]HeaderStaging
  2. Add and link all fields in the map SAB_EDIStagingHeader within the table designer.
  3. Add any additional fields for your document type to the table

Line table

  1. Create new table to store your staging line data.
    Example:
    • EDI[Extension][Inbound]LineStaging
    • EDI[Extension][Outbound]LineStaging
  2. Add and link all fields in the map SAB_EDIStagingLine within the table designer.
  3. Add any additional fields for your document type to the table

Document settings profile

  1. Create new table for settings profile.
    Example: SAB_EDIDocumentSettingProfile_[InboundExample]
  2. Add SAB_EDIDocumentSettingsProfile as relation to your table
    1. Add the following field, to be used by EDI to uniquely identify your setting profile
      • Name: DocumentSettingsProfile
      • Data type: Int64
      • EDT - SAB_EDIDocumentSettingsProfileRecId
    2. Create new index
      • Name - DocumentSettingsProfileIdx
      • Field - DocumentSettingsProfile
      • Alternate key - Yes
    3. Add relationship
      • Related table - SAB_EDIDocumentSettingsProfile
      • Cardinality - ExactlyOne
      • Index - RecId
      • On Delete - Cascade
      • Relationship - Association
  3. Implement SAB_EDIDocumentSettingsContract class for document settings profile parameters
  4. Implement SAB_EDIDocumentSettingsDialogService class for document settings profile dialog
  5. Implement SAB_EDIDocumentSettingsUIBuilder class for document settings profile UI
  6. Create data entity for the settings profile and assign security privileges as required
    Example: SAB_EDIDocumentSettingProfile_[InboundExample]Entity, SAB_EDIDocumentSettingProfile_[InboundExample]EntityMaintain, SAB_EDIDocumentSettingProfile_[InboundExample]EntityView

EDI > Setup > Document types

alt text

[Document name] > Setting profiles > Setup alt text

Implement SAB_EDIDocumentSettingsContract class for document settings profile parameters

  1. Extend the abstract class SAB_EDIDocumentSettingsContract
  2. Add DataContract attribute to the class declaration
  3. Add SAB_EDIDocumentTypeFactory attribute to the class declaration and pass your SAB_EDIDocumentType enum as value.
    Example:
     [SAB_EDIDocumentTypeFactory(SAB_EDIDocumentType::InboundDocument)]
    
  4. Add SysOperationContractProcessing attribute to the class declaration and pass your UI builder class as parameter Example:
     [SysOperationContractProcessing(classStr(SAB_EDIDocumentSettingsUIBuilder))]
    
  5. Implement all of the following methods, see the class library for more information.
    • getProfileFieldId
    • getPprofileTableId
    • serviceClassStr
    • serviceMethodStr - Add your dialog fields as follows
      Example:
       [DataMember,
       SAB_EDIDocumentSettingsFieldMember(fieldStr(SAB_EDIDocumentSettingsProfile_InboundExample, DocumentSettingField1))]
       public Name parmDocumentSettingField1(Name _field1 = documentSettingProfile.DocumentSettingField1)
       {
        documentSettingProfile.DocumentSettingField1 = _field1;
      
        return documentSettingProfile.DocumentSettingField1;
       }
      

Implement SAB_EDIDocumentSettingsDialogService class for document settings profile dialog

  1. Extend the abstract class SAB_EDIDocumentSettingsDialogService
  2. Add your method that will save the settings Example:
     public void run(SAB_EDIDocumentSettingsContract_InboundExample _contract)
     {
         this.saveSettings(_contract);
     }
    

EDI document processing (Inbound)

  1. Create two action menu items for processing the EDI document.
    • Example:
      • SAB_EDIProcessor_InboundExampleSingle
      • SAB_EDIProcessor_InboundExample
    • Properties:
      • Object Type: Class
      • Object: SAB_EDIProcessorController
      • Enum Type Parmeter: SAB_EDIDocumentType
      • Enum Parameter: [Inbound Example] - pass your document type enum
      • Set the multi-select to yes for the non-single one

    EDI > Documents > Inbound example (Note: This will be accessible once step 3 is completed) alt text

  2. Implement EDI processor class to process inbound documents
  3. Create staging forms for EDI documents

Implement EDI processor class to process inbound documents

  1. Extend the EDI processor class dependening on your extension scenario
    • Customers documents - SAB_EDIProcessor_Cust
    • Vendor documents - SAB_EDIProcessor_Vend
    • Freight forwarder landed costs documents - SAB_EDIProcessor_FreightForwarderLandedCost
    • 3PL documents - SAB_EDIProcessor_3PL
    • All other documents - SAB_EDIProcessor
  2. Add SAB_EDIDocumentTypeFactory attribute to the class declaration and pass your SAB_EDIDocumentType enum as value.
    Example:
     [SAB_EDIDocumentTypeFactory(SAB_EDIDocumentType::InboundDocument)]
    
  3. Implement all of the following methods, see the class library for more information.
    • initDocument
    • process
    • postProcess

EDI document processing (Outbound)

  1. Create nnw action menu items for processing the EDI document.
    • Example:
      • SAB_EDIOutboundStagingWriter_OutboundExample
    • Properties:
      • Object Type: Class
      • Object: SAB_EDIOutboundStagingWriterServiceController
      • Enum Type Parmeter: SAB_EDIDocumentType
      • Enum Parameter: [Outbound Example] - pass your document type enum
  2. Implement EDI staging writer class to process outbound documents
  3. Create staging forms for EDI documents

Implement EDI staging writer class to process outbound documents

  1. Extend the SAB_EDIOutboundStagingWriter class dependening on your extension scenario
    • Customers documents - SAB_EDIOutboundStagingWriter_Customer
    • Vendor documents - SAB_EDIOutboundStagingWriter_Vend
    • 3PL documents - SAB_EDIOutboundStagingWriter_3PL
    • All other documents - SAB_EDIOutboundStagingWriter
  2. Add SAB_EDIDocumentTypeFactory attribute to the class declaration and pass your SAB_EDIDocumentType enum as value.
    Example:
     [SAB_EDIDocumentTypeFactory(SAB_EDIDocumentType::OutboundDocument)]
    
  3. Implement all of the following methods, see the class library for more information.
    • caption
    • composeStagingHeader
    • composeStagingLine
    • initQueryRun
    • initQueryRunFromBuffer
    • sourceTableIdHeader
    • sourceTableIdLine
    • tradingPartnerFromSourceHeader
    • tradingPartnerTableId

Create staging forms for EDI documents

  1. Create action menu item for EDI document staging form.
    • Example:
      • SAB_EDIStagingFormRun_InboundExample
    • Properties:
      • Object Type: Class
      • Object: SAB_EDIStagingFormRun
      • Enum Type Parmeter: SAB_EDIDocumentType
      • Enum Parameter: [Inbound Example] - pass your document type enum
  2. Implement SAB_EDIStagingFormClass for EDI documents
  3. Create action menu item for EDI workspace.
    • Example:
      • SAB_EDIStagingFormRunError_InboundExample
    • Properties:
      • Object Type: Class
      • Object: SAB_EDIStagingFormRun
      • Enum Type Parmeter: SAB_EDIDocumentType
      • Enum Parameter: [Inbound Example] - pass your document type enum
  4. Extend the EDI menu item and add your staging form run action menu item under Documents

EDI > Documents > Inbound example

alt text


alt text

Implement SAB_EDIStagingFormClass for EDI documents

  1. Extend the SAB_EDIStagingFormClass
  2. Add SAB_EDIDocumentTypeFactoryAttribute attribute to the class declaration and pass your SAB_EDIDocumentType enum as value.
    Example:
     [SAB_EDIDocumentTypeFactoryAttribute(SAB_EDIDocumentType::InboundDocument)]
    
  3. Implement all of the following methods, see the class library for more information.
    • DocumentType Example:
        protected SAB_EDIDocumentType DocumentType()
        {
            return SAB_EDIDocumentType::InboundExample;
        }
      
    • HeaderIdentificationFieldGroups Example:
        protected List HeaderIdentificationFieldGroups()
        {
            List fieldGroups = new List(Types::String);
                          
            fieldGroups.addEnd(tableFieldGroupStr(EDIExtensionInboundHeaderStaging, Overview));
            fieldGroups.addEnd(tableFieldGroupStr(EDIExtensionInboundHeaderStaging, Details));
      
            return fieldGroups;
        }
      
    • LinesHeaderFieldGroups Example:
        protected List LinesHeaderFieldGroups()
        {
            List fieldGroups = new List(Types::String);
                          
            fieldGroups.addEnd(tableFieldGroupStr(EDIExtensionInboundHeaderStaging, Overview));
            fieldGroups.addEnd(tableFieldGroupStr(EDIExtensionInboundHeaderStaging, Details));
      
            return fieldGroups;
        }
      
    • lineViewGridFieldGroup Example:
        protected str lineViewGridFieldGroup()
        {
            return tableFieldGroupStr(EDIExtensionInboundLineStaging, Details);
        }
      
    • mainGridFieldGroup Example:
        protected str mainGridFieldGroup()
        {
            return tableFieldGroupStr(EDIExtensionInboundHeaderStaging, Overview);
        }