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 :
Microsoft Dynamics AX (Archived)
Answered

How to add a dynamically created print setting (X++) without overwriting the print settings from the print management form?

(0) ShareShare
ReportReport
Posted on by 50

Hello everybody,

I am stuck on one last thing, where I'd appreciate your help.
I have the requirement to print, based on a checkbox value, an additional report-design that prints with the sales invoice.

So it should always be the sales invoice report (the print management settings) + conditionally an additional design.

I've added this method loadAdditionalPrintSetting to the SalesInvoiceController method:

4162.pic1.png

This method is called within the runPrintMgmt method of the SalesInvoiceController class right after this line:
3513.pic2.png

If I run this, it only prints my new design but ignores the print management settings.  Why is it throwing away the previously loaded print settings?  How to prevent this?

Thank you very much for your help in advance.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jannik Profile Picture
    50 on at

    Solved it myself!  In the method PrintMgmtReportRun.loadSettingDetail() the object printSetting is instantinated again, and thus, the old settings were overwritten, when I called _formLetterReport.parmReportRun().loadSettingDetail()., as can be seen here (marked orange):

    public void loadSettingDetail(PrintMgmtPrintSettingDetail _settingDetail, str _documentKeyValue = '')
    {
        printSetting = new PrintMgmtPrintSetting();
        printSetting.addPrintDetail(_settingDetail);
        documentKeyValue = _documentKeyValue;
        this.reset();
    }

    So what I did was create a parm method in the PrintMgmtReportRun class, which returns the printSetting object. I now use this object to add my new print setting dynamically during runtime.  The method loadAdditionalPrintSetting() now has this snipped of code at the end instead of _loadLetterReport.parmReportRun().loadSettingDetail(printSettingDetail, ''):

        printSetting = _formLetterReport.parmReportRun().parmPrintMgmtPrintSetting();
        printSetting.addPrintDetail(printSettingDetail);
        _formLetterReport.parmReportRun().reset(); 

    I hope this helps somebody out there! :)  I wish you all a good night.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Basit Profile Picture

Basit 1

#1
GL-01081504-0 Profile Picture

GL-01081504-0 1

#1
Roya Profile Picture

Roya 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans