Today I had a need to write the same code in AX 2009. It's much simpler in 2009. Just create a form method "customMarkAll" and call it from a button on the custOpenTrans form.
void customMarkAll()
{
CustTransOpen custTransOpenBuffer;
int linesProcessed;
;
for (custTransOpenBuffer = custTransOpen_ds.getFirst(false) ? custTransOpen_ds.getFirst(false) : custTransOpen_ds.cursor();
custTransOpenBuffer; custTransOpenBuffer = custTransOpen_ds.getnext())
{
if (manager.getTransMarked(custTransOpenBuffer) == NoYes::No)
{
manager.updateTransMarked(custTransOpenBuffer, NoYes::Yes);
linesProcessed++;
}
}
element.updateDesignDynamic();
//refresh the screen
element.redraw();
box::info(strfmt("%1 Vouchers Marked",linesProcessed));
}
No comments:
Post a Comment