web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / Electronic Reporting a...
Finance forum

Electronic Reporting and output XML data management.

(0) ShareShare
ReportReport
Posted on by 70

Hi there,

Environment : AX7 8.0 / Update 20

Our client is generating vendor payments with Electronic Reporting payment method, ISO20022 Direct debit (FR) format.
The requirement is the following : During payment file export to user/browser, intercept the XML generated and get the values of certain tags, then save the XML in the database.

I’m struggling to get the class / method in the export payment generation process where I can clearly see the XML and save it in the database, or at least get the tag values that I need.
The classes in which I’m trying to do so are : CustVendPaymERExport, , ERFormatMappingRun, ERFormatMappingRunController… I manage to find the XML in the runFormat.XML variable, but the tag values are GUIDs. Even if I were to translate the XML GUIDs, I wondering how can I extend these classes and get the data, the variables being private.

If someone has an experience with a similar issue, I would appreciate an advice on this subject.
Thanks a lot.

Kind regards,

Saso

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Saso,

    What do you want to intercept exactly and why?

    Can't this be achieved by a modification of the ER model, ER configuration and ER output destination?

    Best regards,

    Ludwig

  • Saso GLIGOR Profile Picture
    70 on at

    Hello Lugwig and thanks for the prompt response.

    The résumé of the requirement is the following : Record the generated vendor payments.
    Technical details :
    When generating vendor payments : Accounts receivable => Payment journal => Lines => Generate payments (Payment method : ISO20022 Direct debit (FR)).
    A file is being created and sent to the users browser. This file is in a XML format mentioned before in the payment method (SEPA).
    This is the content that needs to be recorded. The information will be used for internal client specific processes.

    For the moment, the information that is needed absolutely comes from 2 XML tags. So I could get around recording the whole payment XML only by regenerating the 2 values (I got the formulas in the ER format designer). The problem is that for the moment I have difficulties getting hold of one information from the user dialog. Here are the 2 tags that I need:

    • EndToEndId tag from the XML. This I can regenerate, I have access to all the data needed (JournalNum and LedgerJournalTrans RecId).
    • PmtInfid tag from the XML. This, for now, I cannot regenerate because in my extension methods I cannot get a hold of the “Processing date” standard dialog field entered by user during “Generate payments” process described earlier.

    For the record, I found that a standard field named “PmtInfid” exists in the “CustVendProcessedPayment” table, but it is not filled during payment generation. So I presume that a financial setup could get this field running. I didn’t find out how to do that.
    Long story short, I think that the easiest solution would be to get my hands on the XML payment data generated, save it and extract the information needed. But, I do not master the Electronic Reporting platform, maybe there is an easier way of doing this and I’m looking in the wrong direction. This is why I’m asking for advice.

    Hope that makes it clearer :-)
    Thanks again.

    Kind regards,
    Saso

  • Suggested answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Saso,

    If there is something wrong with the XML tags and information extracted, there is no code adjustment required.

    You should be able to modify the XML output directly in the electronic reporting workspace.

    https://docs.microsoft.com/en-us/dynamics365/unified-operations/dev-itpro/analytics/general-electronic-reporting?toc=/fin-and-ops/toc.json

    The whole workspace and the functionalities available have been created to avoid the necessity of making code modifications that you mentioned.

    I would thus recommend having a look at the documentation and giving the electronic reporting framework a try. Should not be too difficult to change only those two tags.

    Best regards,

    Ludwig

  • Saso GLIGOR Profile Picture
    70 on at

    Hello Ludwig,

    There is nothing wrong with the XML file generated, the ER platform works fine as well.
    I think I exposed my problem at low technical level, I should have started at higher functional level.

    Suppose that I create a vendor payment journal, and then I create a payment file for the journal.
    The ledger journal lines would be marked as “Payed”, the payment XML file would be exported to the user that clicked the “Generate payment” button.
    At this point, the only trace that we have of the payment file is the “Download” folder of the user’s PC, and nowhere else.

    Here comes my requirement, I would like to have the contents of this file, no matter the reasons.
    The variables / methods / classes that generate the payment are mostly private / internal and I have difficulties on extending and getting the information that I need, as described earlier.

    Thank you for answers, I will go through the documentation and see what can be done.

    Kind regards,
    Saso

  • Verified answer
    Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi Saso,

    I see.

    From a 'functional' perspective, you can specify a specific directory (either on SharePoint, a separate database or on Azure where your machine runs) as the output destination.

    This means that the file is not poping up on the screen of the user but rather automatically stored somewhere.

    Where exactly can be specified in the electronic reporting destination where you can e.g. define an email address, an archieve, a SharePoint destination, etc.

    Is that what you are looking for?

    Best regards,

    Ludwig

  • Saso GLIGOR Profile Picture
    70 on at

    Hello Ludwig,

    I’m looking at the ER destinations and it seems quite interesting.

    Considering that the ER module classes seem locked almost completely, this could be my way out.

    I will do some tests and see what can be done to get around my initial requirement.

    Thank you for pointing me in an interesting direction.

    I will post my findings, that might help someone.

    Kind regards.

    Saso

  • Suggested answer
    Saso GLIGOR Profile Picture
    70 on at

    Hello,

    Here is my solution for this requirement, based on the ER Destinations.

    • Create an ER destination for the configuration of your interest.
      Then, for the component that you would like to access, create an “Archive” destination of type “File” (Location Azure storage).

    Photo2.png

    • With this setup in place, the payment will be recorded in the “Electronic reporting jobs” with the XML file attached.
      That gives us the possibility to read this file outside of the non-extensible ER classes, and get the information that we need.

    Photo2.png

    • The final part is extending a class / method that will enable us to read the content of the XML file generated.
      I found the class DocuActionFile, method createFileAttachment() to be a convenient spot.
      The following code is an example of what could be done process the file content.

    Photo3.png

    Kind regards,
    Saso

  • Muhammad Haroon Profile Picture
    2,382 on at

    Hi There

    This community post is very close to my requirement but not exactly the same. In my case, I want to save the EFT file being generated to a shared location but am not able to get an idea of how to achieve this. I tried extending 'CustVendPaymERExport' class and tried to set 'fileDestination' as my desired path but no success. Here is the code for the class which I have extended:

    [ExtensionOf(classStr(CustVendPaymERExport))]
    final class CustVendPaymERExport_Extension
    {
        public void run()
        {
            str filePath = @"C:\Temp\";
            erFileName   = erFileName + "_HAROON";
            
            fileDestination.newFileStream(filePath);
            
            next run();
        }
    }

    Will appreciate if anyone of you could help. 

    Thanks in advance.

    Haroon

  • Saso GLIGOR Profile Picture
    70 on at

    Hello Haroon,

    What you would like to do, save the file generated by AX7 in a shared folder, is not really possible.
    The application is running on a cloud server and it cannot see nor access a shared or local folder.
    Take a look at the following links that talk about these issues :

    https://community.dynamics.com/ax/f/33/t/252403
    https://community.dynamics.com/ax/f/33/t/252348

    What you could do, using ER destinations, is save the file on your SharePoint or Azure Storage.
    If that doesn’t suite your needs, you can use Azure File Storage or FTP (FTPS or SFTP), but it requires coding.
    You could google around AX7 D365FO Azure file storage and FTPS / SFTP implementation.
    For my personal needs I found the following link useful, but there are others also :

    https://stoneridgesoftware.com/sending-flat-files-from-dynamics-365-for-operations-to-a-different-location/

    Kind regards,
    Saso

  • Jone91 Profile Picture
    50 on at

    Hi Saso,

    The solution you provided is very useful to almost achieve my requirement.

    After configuring ER File Destination the file is archived successfully.

    Is we can able to restrict the file downloading to the user after clicking generate payment?

    Thanks in advance.

    Regards,

    Alex Jones

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Finance

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans