Hello:
I have the code below to generate a free text invoice.
CustInvoiceJour custInvoiceJourLocal = CustInvoiceJour::findRecId(5637916829);
Args args = new Args();
args.record(custInvoiceJourLocal);
new MenuFunction(menuitemOutputStr(FreeTextInvoiceOriginal), MenuItemType::Output).run(args);
My question is if it's possible to pass along print settings to be able to email the invoice to a specific address? I've tested the code snippet below and it does allow email, but in the context of the code above, I'm not sure if it can be used.
SRSPrintDestinationSettings settings = controller.parmReportContract().parmPrintSettings();
SrsReportEMailDataContract emailContract = new SrsReportEMailDataContract();
emailContract.parmTo(testEmailString);
emailContract.parmSubject("Invoice");
emailContract.parmBody(strFmt("Hi there! Here is your invoice. Invoice#:%1", custInvoiceJour.InvoiceId));
emailContract.parmAttachmentFileFormat(SRSReportFileFormat::PDF);
settings.printMediumType(SRSPrintMediumType::Email);
settings.fileFormat(SRSReportFileFormat::PDF);
settings.fileName(strFmt("%1", custInvoiceJour.InvoiceId));
settings.parmEMailContract(emailContract);
Any help would be appreciated. Thank you!