Hi everyone,
i am trying to save Purch/Sales-Invoices by using a class. Non FreeTextInvoices work fine, it's saving the PDFs right to the place I selected in my dialog. All FreeTextInvoices however open up on screen and are not saved as PDF. Here are the essentials of my code:
_SalesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice, false);
_PrintJobSettings = new PrintJobSettings();
_PrintJobSettings.setTarget(PrintMedium::File);
_PrintJobSettings.preferredTarget(PrintMedium::File);
_PrintJobSettings.format(PrintFormat::PDF_EMBED_FONTS);
_PrintJobSettings.fileName(_PathToFile+_Filename);
_PrintJobSettings.warnIfFileExists(false);
_printJobSettings.suppressScalingMessage(true);
_SalesFormletter.updatePrinterSettingsFormLetter(_PrintJobSettings.packPrintJobSettings(), PrintSetupOriginalCopy::Original);
args.record(_CustInvoiceJour);
args.caller(_SalesFormLetter);
new MenuFunction(menuitemoutputstr(SalesInvoice), MenuItemType::Output).run(args);
Does anyone have an idea why it's opening up the free text invoices on screen instead writing those to the filesystem? I also tried the code to save Purchase Invoices and got exactly the same result.
Thanks for any help,
Marc