web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

AX 2012 - Grid lines - Filter records and select all the filtered records

(0) ShareShare
ReportReport
Posted on by 1,087

Hi,

i have a new grid i've done, with a button that selects all the records in the grid.

If i filter records with CTRL+G function and then i push the "select all" button,

it doesnt select the filtered records, but it selects all the records that were previously retrieved from the init query of the form.

The code of select all button is:

void clicked()

{

   QueryRun    queryRun;

   InventTrans InventTransds;

   ;

   super();

   queryRun = new QueryRun(InventTrans_1_q);

   queryRun.query().dataSourceTable(tableNum(InventTrans)).addSelectionField(fieldNum(InventTrans, Recid));

   while (queryRun.next())

   {

       InventTransds = queryRun.get(tableNum(InventTrans));

       InventTransSet.add(InventTransds.recid);

   }

   InventTrans_1_ds.research();

}

How can i make my button select only the filtered records?

Is there a standard form with the same  behavior?

Thank you in advance

regards

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: AX 2012 - Grid lines - Filter records and select all the filtered records

    replace the line

    queryRun = new QueryRun(InventTrans_1_q);

    with this line

    queryRun = new queryRun(InventTrans_1_ds.queryRun().query());

    then it should work

  • vv1984 Profile Picture
    1,087 on at
    RE: AX 2012 - Grid lines - Filter records and select all the filtered records

    Thank you very much, it worked like a charm!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Priya_K Profile Picture

Priya_K 4

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 3

#3
Scott_itD Profile Picture

Scott_itD 2 Community Manager

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans