01 March 2020

How to extend standard report (Purchase order report ) in D365 F&O using print management / Report extension in D365

Dynamics Ax 365 SSRS: How to call new Report/Design for existing Print management report

To get the report format in the setup Print management setup:
Need to create extension for the PrintMgmtReportFormatPopulator->addDocuments()
Need to add the new report to get the report in the configuration

Step1. Duplicate the PurchPurchaseOrder standard Report as PurchPurchaseOrderADD
Step2. Go to PrintMgmtDocType class and copy the eventHandler delegate method called getDefaultReportFormatDelegate
Step3. Create new class "PrintMgmtDelegatesHandler_Test" and paste the eventHandler.

below is reference code. To execute the report different designs per each legal entity.

Once we done this - Need to go to AP-Setup-Forms->Form setup -> Print Management button then in that form have to select the that related Purchase order report in the dropdown.



class PrintMgmtDelegatesHandler_Test
{
    /// <summary>
    ///
    /// </summary>
    /// <param name="_docType"></param>
    /// <param name="_result"></param>
    [SubscribesTo(classStr(PrintMgmtDocType), delegateStr(PrintMgmtDocType, getDefaultReportFormatDelegate))]
    public static void PrintMgmtDocType_getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)
    {
        PrintMgmtReportFormatName formatName = PrintMgmtDelegatesHandler_Test::getDefaultReportFormat(_docType);
        if (formatName)
        {
            _result.result(formatName);
        }
    }

    private static PrintMgmtReportFormatName getDefaultReportFormat(PrintMgmtDocumentType _docType)
    {

        switch (_docType)
        {
            case PrintMgmtDocumentType::PurchaseOrderRequisition:
                {
                    if(curExt() == "USMF")
                    {
                        return ssrsReportStr(PurchPurchaseOrderADD, Report);
                    }
                    if(curExt() == "RUMF")
                    {
                        return ssrsReportStr(PurchPurchaseOrderADD, ReportRU);
                    }

                }
            case PrintMgmtDocumentType::PurchaseOrderConfirmationRequest:
                {
                    if(curExt() == "USMF")
                    {
                        return ssrsReportStr(PurchPurchaseOrderADD, Report);
                    }
                    if(curExt() == "RUMF")
                    {
                        return ssrsReportStr(PurchPurchaseOrderADD, ReportRU);
                    }
                }
        }
        return '';
    }

}

Need to execute the below job to populate new report design in the Print management setup Table(PrintMgmtReportFormat) can open see new report is inserted in this table or not after executing below populate method.

class PrintPopulateReportFormat
{
    public static void main(Args _args)
    {
        PrintMgmtReportFormatSubscriber::populate();
        
    }
}

4 comments:

  1. Your Affiliate Money Making Machine is ready -

    Plus, getting it set up is as easy as 1, 2, 3!

    Here is how it works...

    STEP 1. Tell the system what affiliate products the system will push
    STEP 2. Add some push button traffic (it LITERALLY takes 2 minutes)
    STEP 3. Watch the system grow your list and sell your affiliate products all by itself!

    Are you ready to make money automatically??

    Your MONEY MAKING affiliate solution is RIGHT HERE

    ReplyDelete
  2. Hi sir,

    could you please post, how to upload file using sys operation framework in D365

    ReplyDelete
  3. Thank you! this was extremely helpful!

    ReplyDelete

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...