Skip to main content

Notifications

Community site session details

Community site session details

Session Id :

‘Select all’ ctrl-A is selecting only 20 records in the Form grid

Fawad Hassan Profile Picture Fawad Hassan 337

There is an issue with the Grids in Ax 2012 where select all or ctrl A or clicking top check box in the grid, selects only 20 records and if you want to iterate or check the number of records through code, it will always show 20 even though the records are more than 20 in the Grid.

The reason behind is, the Grid control in Ax does not load all the records on the initialization of the Form, if the records are more than 20 and user has to scroll the whole grid to make Ax select all the records and to get the correct count in the code.

The more technical explanation of this could be, there are only 20 records marked when the user clicks the top check box in the Grid and to get all the records, code has to mark all the records by iterating through all the rows in the Grid. Something like below

recordsCount = student_ds.recordsMarked().lastIndex(); // Total no of marked records.

studentLocal = student_ds.getFirst(1);

while (studentLocal)

{

info(studentLocal.Name +" " +studentLocal.ID);

studentLocal = student_ds.getNext();

}

User can manually press Ctrl + Shift+ End to select all the records. I also tried passing this key strokes through the code but the key strokes didn’t work through code. The key stroke for Ctrl + Shift+ End is 2824.

More helpful Links can be found below
http://soft-maya.blogspot.com/2012/11/retrieve-multiple-selected-records-from.html

http://community.dynamics.com/ax/f/33/t/107379.aspx


This was originally posted here.

Comments

*This post is locked for comments