Greetings,
I've written some custom code to create invoices for a specific situation. I'm using the code pasted below. I've noticed that the SalesParmUpdate record is reused and the related SalesParmTable rows are changed whenever my customization is executed. It does not seem to be the case with what SalesEditLines perform, as the parmId is always incremented. I haven't seen any "closing" method which must be done after SalesFormLetter.run() or clean-up process.
So basically, if anyone knows, am I missing some lines which prevent parmId to be reused or is it meaningless and can be disregarded?
private void createInvoice(Query _query, TransDate _invoiceDate, SalesUpdate _salesUpdate)
{
SalesFormLetter salesFormLetter;
QueryRun queryRun;
ParmId parmId;
queryRun = new QueryRun(_query);
salesFormLetter = SalesFormLetter::construct(DocumentStatus::Invoice);
salesFormLetter.specQty(_salesUpdate);
salesFormLetter.chooseLinesQuery(queryRun);
salesFormLetter.transDate(_invoiceDate);
salesFormLetter.printFormLetter(false);
salesFormLetter.chooseLines();
salesFormLetter.SumBy(AccountOrder::Account);
salesFormLetter.reArrange(false);
parmId = salesFormLetter.parmId();
salesFormLetter.run();
}
AX 2012 cu3 release 8
Regards,
Eric
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (