Dynamics AX Blog - Posts from 16 November 2014
These posts are machine-translated.
Print purchase order through codeThe following job demonstrates, how you can print an existing Purchase order through code. The example sends the report to screen. static void printPurchaseOrderThroughCode(Args _args)
{ PurchPurchOrderJournalPrint purchPurchOrderJournalPrint; Set set = new Set(Types::Record); SRSPrintDestinationSettings srsPrintDestinationSettings; // Add record set.add(VendPurchOrderJour::findRecId(5637179849)); // Set printer settings srsPrintDestinationSettings = new SRSPrintDestinationSettings(); srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::Screen); // Initalize purchPurchOrderJournalPrint = PurchPurchOrderJournalPrint::construct(); purchPurchOrderJournalPrint.parmPrintFormletter(NoYes::Yes); purchPurchOrderJournalPrint.parmUsePrintManagement(false); purchPurchOrderJournalPrint.parmPrinterSettingsFormLetter(srsPrintDestinationSettings.pack()); purchPurchOrderJournalPrint.printJournal(set); } |
|
|
|
|
|
|

The following job demonstrates, how you can print an existing Sales confirmation through code. The example sends the report to screen.
{
SalesConfirmJournalPrint salesConfirmJournalPrint;
Set set = new Set(Types::Record);
SRSPrintDestinationSettings srsPrintDestinationSettings;
// Add record
set.add(CustConfirmJour::findRecId(5637155842));
// Set printer settings
srsPrintDestinationSettings = new SRSPrintDestinationSettings();
srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::Screen);
// Initalize
salesConfirmJournalPrint = SalesConfirmJournalPrint::construct();
salesConfirmJournalPrint.parmPrintFormletter(NoYes::Yes);
salesConfirmJournalPrint.parmUsePrintManagement(false);
salesConfirmJournalPrint.parmPrinterSettingsFormLetter(srsPrintDestinationSettings.pack());
// Print
salesConfirmJournalPrint.printJournal(set);
}