Wednesday, October 5, 2011

Loop through SELECTED records on an AX Form - AX 2009

We have the ability to loop through SELECTED records on a AX form in X++.

There are many ways to accomplish this in AX, but based on my requirements I made the choice of looping through the selected records in a button's click() method.


CustInvoiceJour                     localCustInvoiceJour;
FormDataSource                      form_ds;
Common                              common
;
 //super();

//Set form data source
form_ds = CustInvoiceJour_ds;

for(common = form_ds.getFirst(true)?form_ds.getFirst(true):CustInvoiceJour_ds.cursor(); 
     common;
     common = form_ds.getNext())
    {

        localCustInvoiceJour = common;

        …Implementation…
    }

1 comment:

Thank you for your thoughts. Your comment will appear in my blog shortly after review.

Have a great day!