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
Post a Comment