Sunday, 25 November 2018

Job to get the print management report format name through X++ code in D365

Recently I have a got a requirement in which I want to get the SSRS report format name selected in print management settings, for that I have created a job to get the report format name in print management settings.

For this example, I am using Customer Invoice report (e.g., SalesInvoice.Report).












Note: We can use print management settings for SSRS report through "Use Print Management" menu.

Source code explanation:
  • Document type here, Sales order invoice. (Enum)
  • Table joins:
    • PrintMgmtDocInstance table holds information about the overwritten destinations.
    • PrintMgmtReportFormat table contains SSRS report names that users can choose from as alternatives for reports that are controlled by print management.
    • PrintMgmtSettings table contains specific print management settings that are applied when a document is printed.
  • Get the report name from PrintMgmtReportFormat table, Name field contains the report format name.














Result:


1 comment:

  1. PrintMgmtDocInstance printMgmtDocInstance;
    PrintMgmtReportFormat printMgmtReportFormat;
    PrintMgmtSettings printMgmtSettings;

    select DocumentType, RecId from printMgmtDocInstance
    where printMgmtDocInstance.DocumentType == PrintMgmtDocumentType::CustAccountStatement
    join ParentId, ReportFormat from printMgmtSettings
    where printMgmtSettings.ParentId == printMgmtDocInstance.RecId
    join RecId, DocumentType, Name from printMgmtReportFormat
    where printMgmtReportFormat.RecId == printMgmtSettings.ReportFormat && printMgmtReportFormat.DocumentType == PrintMgmtDocumentType::CustAccountStatement;

    return printMgmtReportFormat.Name;

    ReplyDelete

Set up Online VM for Dynamics 365 Finance and Operation for Technical and Functional Learning Purposes

In this blog, I will discuss how we set up an online VM for D365F&O for Technical and Functional learning purposes for free. Step: 1 Cl...