Dynamics AX Blog - report - Posts from 2014
These posts are machine-translated.
Currently, only posts from »2014« are displayed
Print sales invoice through codeThe following job demonstrates, how you can print an existing Sales invoice through code. The example sends the report to screen. static void printSalesInvoiceThroughCode(Args _args)
{ SalesInvoiceJournalPrint salesInvoiceJournalPrint; Set set = new Set(Types::Record); SRSPrintDestinationSettings srsPrintDestinationSettings; // Add record set.add(CustInvoiceJour::findRecId(5637188088)); // Set printer settings srsPrintDestinationSettings = new SRSPrintDestinationSettings(); srsPrintDestinationSettings.fileFormat(SRSReportFileFormat::Screen); // Initalize salesInvoiceJournalPrint = SalesInvoiceJournalPrint::construct(); salesInvoiceJournalPrint.parmPrintFormletter(NoYes::Yes); salesInvoiceJournalPrint.parmUsePrintManagement(false); salesInvoiceJournalPrint.parmPrinterSettingsFormLetter(srsPrintDestinationSettings.pack()); salesInvoiceJournalPrint.printJournal(set); } |
|
|
|
|
|
|
The following job demonstrates, how you can print an existing Sales packing slip through code. The example sends the report to screen.
Changing the parameter of the instance of SRSPrintDestinationSettings allows you to send the sales packing slip to printer, file or mail. The next example creates a PDF-file.
If you want to print multiple sales confirmations at once, you have to add the corresponding CustPackingSlipJour-records to the set called "set:
To additionally save the sales packing slip to print archive, you can add the following line: