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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

How to differentiate Electronic reporting destination settings (File, Email)

(0) ShareShare
ReportReport
Posted on by

Hello,

We have created an ER which generated excel file.

I have created a menu item on the Transfer order form, which directly executes and downloads the file.

For that we have to enable File in destination settings.

Now we want to have same file generated and sent to predefined e-mail address during the Transfer order ship process.

My question is how to differentiate in code in what destination file should go?

My current code which is executed by actiion menu item looks like below.

So is there a possibility to manage / modify the destination settings through code?

ERIFormatMappingRun formatMappingRun = ERObjectsFactory::createFormatMappingRunByFormatMappingId(_contract.parmERFormatMappingId())
            .withParameter(new ERModelDefinitionDatabaseContext()
                .addValue(tableNum(InventTransferJour), fieldNum(InventTransferJour, TransferId), _contract.parmTransferId())
                .addValue(tableNum(InventTransferJourLine), fieldNum(InventTransferJourLine, TransferId), _contract.parmTransferId())
                .addValue(tableNum(InventTransferJourLine), fieldNum(InventTransferJourLine, VoucherId), _contract.parmVoucherId()))
            .withFileDestination(_contract.getFileDestination());
        
        formatMappingRun.parmShowPromptDialog(false);
        formatMappingRun.run();

I have the same question (0)
  • Suggested answer
    Laura Manache Profile Picture
    on at

    Hi,

    Thank you for reaching out to Microsoft community. Could you please provide more details about the business requirements for customizing this processing and not using the existing ER options?

    For further references, please also consider the below articles that provides an insights on how to configurate the ER destinations: docs.microsoft.com/.../electronic-reporting-destinations

    With kind thoughts,
    Laura

  • DAX Dev Profile Picture
    on at

    Hello Laura,

    Thanks for reaching out.

    the requirement is as follow:

    We have created a ER for Transfer Order History (Journal, Lines).

    Our goal is to use this ER in two ways.

    1. We created action menu item and classes which runs the code shown above in the post.

    This executes the ER and generates the file based on the Destination settings. So, if I have enabled "File" in settings, then file is downloaded directly by clicking menu item.

    2. Second way we want to use new ER is to send the generated file automatically to the predefined e-mail destinations during the "Ship transfer order" process.

    So, question is how can I achieve it? If I create 2 type of settings, One for File and another for an E-mail, how can I code it to differentiate which setting to be used?

  • Suggested answer
    Laura Manache Profile Picture
    on at

    Hi,

    Please have a look at this TSG article that contains more details about how to customize the storage location for generated documents. Using the sample code as a reference, you can define your own destination setting:
    docs.microsoft.com/.../er-custom-storage-generated-documents

    Please let me know if this helps or if further assistance is needed.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 592 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 478 Super User 2025 Season 2

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 305 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans