Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Print SalesInvoice custom design

(0) ShareShare
ReportReport
Posted on by 2,983

We have created a custom design for SalesInvoice report, so now we have 2 designs:

1. SalesInvoice.Report (standard default design)

2. SalesInvouce.Custom

We call our report from the CustInvoiceJournal where there is this call 

new MenuFunction(menuitemOutputStr(SalesInvoiceOriginal), MenuItemType::Output).run(args);

So, now we have modified out controller class like this:

SalesInvoiceController.main():

 //>>CUSTOM CODE
    custInvoiceJour = _args.record();
    if (custInvoiceJour.InvoicePrintType == InvoicePrintType::PackingSlipInvoice)
    {
            formLetterController.parmReportName(ssrsReportStr(SalesInvoice, Custom));
    }
    //<<CUSTOM CODE
    formLetterController.parmShowDialog(false);
    formLetterController.startOperation();


The issue is that even when we set parmReportName to ssrsReportStr(SalesInvoice, Custom), the default design "SalesInvoice.Report" is executed.

Any ideas on how to actually execute our custom design?

*This post is locked for comments

  • Ghetz Profile Picture
    Ghetz 2,983 on at
    RE: Print SalesInvoice custom design

    OK, I found a way to set the report design at runtime, without affecting the rest of Print Management settings:

    SalesInvoiceController.outputReport()

    //>>CUSTOM DESIGN
    if (custInvoiceJour.InvoicePrintType == InvoicePrintType::PackingSlipInvoice)
    {
    detail.parmReportFormatName(ssrsReportStr(SalesInvoice, CustomDesign)); 
    }
    //<<CUSTOM DESIGN
    
  • Ghetz Profile Picture
    Ghetz 2,983 on at
    RE: Print SalesInvoice custom design

    Certainly in print management I have a conditional configuration depending on my "InvoicePrintType " field. This works correctly if I use print management when printing from the CustInvoiceJournal.

    However, it seems like when I print using the MenuItemButtons, for example OriginalPrint, print management is ignored, at least partially.(It should only print the original and not the copy)

    In any case, I need to completely avoid print management and select the invoice design on runtime, because when using MenuitemButtons, the conditional configuration is completely ignored

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans