This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
With the following job you can reprint an order confirmation by code and have it output as a PDF file.
With the help of similarly named classes such as the SalesConfirmJournalPrint used here, it should also be possible to reprint other documents such as invoices or delivery notes.
static void printSalesConfirmThroughCode(Args _args) { SalesConfirmJournalPrint SalesConfirmJournalPrint; set set = new set(Types::Record); SRSPrintDestinationSettings SRSPrintDestinationSettings; // Add record set.add(CustConfirmJour::findRecId(5637150827)); // Set printer settings SRSPrintDestinationSettings = new SRSPrintDestinationSettings(); SRSPrintDestinationSettings.fileFormat( SRSReportFileFormat::PDF); SRSPrintDestinationSettings.fileName(@'c:ab.pdf'); SRSPrintDestinationSettings.printMediumType( SRSPrintMediumType::File); SRSPrintDestinationSettings.numberOfCopies(1); SRSPrintDestinationSettings.overwriteFile(true); // Initalize SalesConfirmJournalPrint = SalesConfirmJournalPrint::construct(); SalesConfirmJournalPrint.parmPrintFormletter(NoYes::Yes); SalesConfirmJournalPrint.parmUsePrintManagement(false); SalesConfirmJournalPrint.parmPrinterSettingsFormLetter( SRSPrintDestinationSettings.pack()); // Print SalesConfirmJournalPrint.printJournal(set); }