Monday, February 3, 2014

MutliSelection of records on a Grid in AX

Hi Guys.....

Below is the Code to retrieve the Selected records on a Grid......

First make sure that the MultiSelect  Property for the Button Control is set to YES.

then  write the below code in the clicked method to get the list of selected records..

void clicked()
{
CustTable Customers;

super();

//getFirst method gets all the selected records in the grid
Customers = CustTable_ds.getfirst(true);
while (Customers)
{
info(strfmt("You selected Customer %1",Customers.AccountNum));
// get the next selected record
Customers = CustTable_ds.getNext();
}
}

No comments:

Post a Comment