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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Getting user filter values from a grid

(0) ShareShare
ReportReport
Posted on by 110

I'm working on a form customization right now, on the InventOnhandItem form. As part of this customization, I need to retrieve any values that the user has typed into the "ctrl-g" filter fields.

I thought that maybe I could figure this out by looking at the query, but these filters don't seem to be added to the query. (Either that, or I'm looking at the wrong query.)

I'm wondering if there's a way to just iterate through the filter fields and pull the values from them, but I haven't been able to figure that out. Any help would be appreciated. Thanks!

*This post is locked for comments

I have the same question (0)
  • Verified answer
    David Massey Profile Picture
    Microsoft Employee on at

    Try looking at the query object returned by QueryRun().Query().

  • Andrew Huey Profile Picture
    110 on at

    David - Yes, that was pretty much what I was looking for, thanks.

    If I do:

       qbds = InventSum_ds.queryRunQueryBuildDataSource();

       info(qbds.toString());

    then, I see the query with the expected 'where' clause.

    My next issue, though, is that I haven't figured out how to extract the filters from the QueryBuildDataSource object.

    Using qbds.findRange(...) doesn't seem to return them as I would expect.

    I'm wondering if I'm doing something wrong (again), or if it's just not possible to extract the user filters that way.

  • Verified answer
    David Massey Profile Picture
    Microsoft Employee on at

    The values are not treated as ranges to the query.  Instead they are filters.  Additional pieces of code to look at are SysQuery::queryHasFilters(), QueryFilter object which has the information for datasource, field, and value.

  • Andrew Huey Profile Picture
    110 on at

    David -

    Strangely enough, the SysQuery class on my system doesn't have the queryHasFilters() static method in it. I can see that someone else at my company had made some changes to SysQuery at some point, so I guess maybe it got accidentally deleted at some point.

    Regardless, though, I see that I need to look at QueryFilter rather than range, so I'm on the right track.

    Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#1
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#1
Pratik Bhosle Profile Picture

Pratik Bhosle 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans