Monday, November 8, 2021

Adding custom design in place of standard print management report in Dynamics 365 finance and operations

Please use below extensions to swap standard print management report to custom one.

//

/// Populates the PrintMgmtReportFormat table used for print management with the MyProject documents.

/// 

[ExtensionOf(classStr(PrintMgmtReportFormatPopulator))]

final class JPPrintMgmtReportFormatPopulator_Extension

{

    #ISOCountryRegionCodes

    #PrintMgmtSetup

    /// <summary>

    /// /Added new project invoice report

    /// </summary>

    protected void addDocuments()

    {

        this.addOther(PrintMgmtDocumentType::SIProjInvoice, ssrsReportStr(PSAProjInvoice, Report), ssrsReportStr(JPPSAProjInvoice, Report), #NoCountryRegionId);

        next addDocuments();

    }

}


///Print custom design in place of standard print managment report

/// <summary>

/// Event handler for <c>PrintMgmtDocumentType</c> class

/// </summary>

public class JPPrintMgmtDocType_EventHandler

{

    [SubscribesTo(classstr(PrintMgmtDocType),delegateStr(PrintMgmtDocType, getDefaultReportFormatDelegate))]

    public static void getDefaultReportFormatDelegate(PrintMgmtDocumentType _docType, EventHandlerResult _result)

    {

        switch(_docType)

        {

            case PrintMgmtDocumentType::SIProjInvoice:

                _result.result(ssrsReportStr(JPPSAProjInvoice, Report));

                break;

        }

    }

}


Hope this helps!, I will come up with another interesting blog post.