X++ Find SSRS print management setting for selected customer and report
static void VNPrintMgmtDoc(Args _args)
{
PrintMgmtDocInstance printMgmtDocInstance;
CustTable custTable;
PrintJobSettings printJobSettings;
PrintMgmtSettings printMgmtSettings;
SRSPrintDestinationSettings srsPrintDestinationSettings;
custTable = CustTable::find("ABC");
printMgmtDocInstance = PrintMgmtDocInstance::findByPrintType(custTable.RecId,custTable.TableId,PrintMgmtNodeType::CustTable,PrintMgmtDocumentType::SalesOrderInvoice,PrintMgmtDocInstanceType::Original,false);
select printMgmtSettings where printMgmtSettings.ParentId == printMgmtDocInstance.RecId;
srsPrintDestinationSettings = new SRSPrintDestinationSettings(printMgmtSettings.PrintJobSettings);
info(strFmt("%1",srsPrintDestinationSettings.fileFormat()));
info(strFmt("%1",srsPrintDestinationSettings.emailTo()));
info(strFmt("%1",srsPrintDestinationSettings.emailAttachmentFileFormat()));
}
{
PrintMgmtDocInstance printMgmtDocInstance;
CustTable custTable;
PrintJobSettings printJobSettings;
PrintMgmtSettings printMgmtSettings;
SRSPrintDestinationSettings srsPrintDestinationSettings;
custTable = CustTable::find("ABC");
printMgmtDocInstance = PrintMgmtDocInstance::findByPrintType(custTable.RecId,custTable.TableId,PrintMgmtNodeType::CustTable,PrintMgmtDocumentType::SalesOrderInvoice,PrintMgmtDocInstanceType::Original,false);
select printMgmtSettings where printMgmtSettings.ParentId == printMgmtDocInstance.RecId;
srsPrintDestinationSettings = new SRSPrintDestinationSettings(printMgmtSettings.PrintJobSettings);
info(strFmt("%1",srsPrintDestinationSettings.fileFormat()));
info(strFmt("%1",srsPrintDestinationSettings.emailTo()));
info(strFmt("%1",srsPrintDestinationSettings.emailAttachmentFileFormat()));
}
Comments
Post a Comment