The 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);
The following job demonstrates, how you can print an existing Sales invoice through code. The example sends the report to screen.
{
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());
// Print
salesInvoiceJournalPrint.printJournal(set);
}