Hi,
We've had some modification work done by a VAR on our install of AX 2009 so that instances of SalesInvoice are sent out by email to the customer that the invoice is for through a modification to Print Management, which is working well.
Now, we need to be able to reprint some of those invoices in case there is an issue, such as for example the SMTP server not working, the wrong email address being stored etc.
The CustInvoiceJournal form has a menu item which almost does exactly what we need under Preview/Print > Use Print Management. However, this uses the local user's email client. I want to replicate the functionality of this button to run in batch instead of on the client.
The button has the following in the clicked method:
while (custInvoiceJourLocal)
{
args.record(custInvoiceJourLocal);
if (custInvoiceJourLocal.SalesId)
{
new MenuFunction(menuitemoutputstr(SalesInvoice), MenuItemType::Output).run(args); // Sales order invoice
}
else
new MenuFunction(menuitemoutputstr(FreeTextInvoice), MenuItemType::Output).run(args); // Free text invoice
if (! journalList.next(custInvoiceJourLocal))
break;
}
super();
Presumably I have to alter the two lines in bold in some way so that the report is generated in batch rather than just instigated locally.
Please could someone give me some guidance on how to proceed?