How to get any Report Name from Print Management in D365 FO x++

   private PrintMgmtReportFormatDescription getReportFormatDescription(PrintMgmtDocumentType _docType)

  {

      PrintMgmtReportFormatDescription printMgmtReportFormatDescription;


      RecId printMgmtDocInstanceRecId = PrintMgmtDocInstance::getPrintMgmtDocRecId(

          0,

          0,

          PrintMgmtNodeType::Sales,

          _docType,

          PrintMgmtDocInstanceType::Original);


      if (printMgmtDocInstanceRecId)

      {

          PrintMgmtReportFormat printMgmtReportFormat;

          PrintMgmtSettings printMgmtSettings;


          select firstonly Description, SSRS from printMgmtReportFormat

              exists join printMgmtSettings

                  where printMgmtSettings.ReportFormat == printMgmtReportFormat.RecId

                  && printMgmtSettings.ParentId == printMgmtDocInstanceRecId;


          if (printMgmtReportFormat.SSRS == PrintMgmtSSRS::SSRS)

          {

              printMgmtReportFormatDescription = printMgmtReportFormat.Description;

          }

      }


      return printMgmtReportFormatDescription;


  }

Comments

Popular posts from this blog

step 20 Update script for service model: AOSService on machine: CR-VM-Test-1

create movement journal through code in d365 FO x++