ER Sales Invoice XML Enhancement for Currency-Specific Bank Account Retrieval

 

Purpose

The purpose of this document is to explain the customization implemented in the Electronic Reporting (ER) Sales Invoice XML generation process in Microsoft Dynamics 365 Finance and Operations (D365FO). This enhancement enables the system to automatically retrieve and populate bank details based on the invoice currency while generating the XML file.

This functionality can be useful for the following scenarios:

  • Automatically selecting the appropriate bank account and IBAN based on the sales invoice currency.
  • Supporting customers who maintain multiple bank accounts for different currencies.
  • Eliminating manual updates to bank details in ER-generated XML files.
  • Ensuring accurate payment information is included in electronic invoice documents.
  • Simplifying maintenance through a configurable currency-to-bank-account mapping table.

Product

Microsoft Dynamics 365 Finance and Operations (D365FO)

Development Approach

The solution is implemented through an Electronic Reporting (ER) configuration extension using a custom parameter table and ER model mapping enhancements.

The implementation consists of the following components:

  1. Custom Parameter Table
    • A custom table (TestCurrencyBankAccounts) is created to maintain currency-wise bank account details.
    • The table stores information such as:
      • Currency Code
      • Bank Account
      • IBAN
  2. Extend model to add new field.
  1. ER Model Mapping Extension

    • The custom table is added as a new data source in the ER Model Mapping.
    • The data source is configured as a cached root data source to improve performance.
                    




  1. Calculated Field Creation

    • A calculated field is added under the Parameters node to identify the appropriate bank detail record based on the invoice currency.

    Example Formula:

    This returns the matching record from the custom table for the invoice currency.

CurBankaccounts = ur banck account name where ur added ur custome table in above step.
CustInvoiceJour = is your source data to filter ur table records


  1. ER Format Mapping Extension

    • The Sales Invoice XML format is extended.
    • The newly created model fields are mapped to the corresponding XML elements.
    • During XML generation, ER automatically retrieves and populates the correct bank details based on the invoice currency.

Technical Considerations Important

  • Multiple ER formats and model mappings may exist in the environment. Before implementing the enhancement, the active ER Format and its associated Model Mapping must be identified. The customization should be performed only in the model mapping used by the Sales Invoice XML format.
  • To identify respective model mapping refer below Your format mapping
below are the model mappings available 




Identify correct model mapping for ur format mapping. other wise your changes won't be reflect 



Business Benefits

  • Supports multi-currency banking requirements.
  • Reduces manual intervention in invoice processing.
  • Improves accuracy of payment information in XML documents.
  • Provides a flexible and maintainable configuration-driven solution.
  • Enhances automation of electronic invoicing processes.
Thank you

Comments