Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

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

(0) ShareShare
ReportReport
Posted on by 1,085

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

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

    Thank you very much, it worked like a charm!

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee 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

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,735 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,466 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans