[D365] How to add custom report designs to print management lookup
Creating a new SSRS Report design for a customer is not a big deal.
Overwriting the default report design for a specific document type in the print management is also simple, it just needs an event handler on PrintMgmtDocType.getDefaultReportFormatDelegate
with a switch statement on the document type that modifies the _result.result()
value.
Adding additional report designs to the lookup of a specific document type to the print management without overwriting the default needs another way.
Create an extension on class PrintMgmtReportFormatPopulator
and add a Chain of Commands (CoC) method to it to hook on the method addDocuments
:
///
/// Populates the PrintMgmtReportFormat table used for print management with the erah documents.
///
[ExtensionOf(classStr(PrintMgmtReportFormatPopulator))]
public final class PrintMgmtReportFormatPopulatorAppSuite_myClass_Extension
{
#ISOCountryRegionCodes
#PrintMgmtSetup
protected void addDocuments()
{
// Purchasing documents
this.myAddPurchaseDocuments();
next addDocuments();
}
///
/// Adds purchase records to the PrintMgmtReportFormat table.
///
public void myAddPurchaseDocuments()
{
this.addOther(PrintMgmtDocumentType::PurchAgreementConfirmation, ssrsReportStr(myPurchPromptLetterReport, Report), ssrsReportStr(myPurchPromptLetterReport, Report), #NoCountryRegionId);
this.addOther(PrintMgmtDocumentType::PurchAgreementConfirmation, ssrsReportStr(mySecondPurchPromptLetterReport, Report), ssrsReportStr(mySecondPurchPromptLetterReport, Report), #NoCountryRegionId);
}
}