Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Get grid filtered value

Posted on by 1,048

Hi Experts,

I have some 15 columns in the form grid among that i wanted to get the user filter data for 1 columns (I can get active data of grid using execute query method of data Source), Ex:- 

823681.Capture.PNG

In the above screen if user filtered transaction code as 'APP'. I wanted to get value 'APP' based on that i need to calculation for amount. If user filtered any other column amount should be remain same. Can anyone help me on this ?

Regards

Guru

*This post is locked for comments

  • Guruprasanna Profile Picture
    Guruprasanna 1,048 on at
    RE: Get grid filtered value

    Thank you Rustem Galiamov and

    ievgen Miroshnikov for help !

  • Suggested answer
    Mea_ Profile Picture
    Mea_ 60,278 on at
    RE: Get grid filtered value

    Hi Guruprasanna M,

    It's a very strange requirement and I would recommend you to rethink it, however, if you want to get your value you can use next code:

    QueryBuildDataSource qbds = myTable_ds.queryRun().query().dataSourceTable(tableNum(MyTable));
    QueryBuildRange qbr = qbds.findRange(fieldNum(MyTable, MyField));
    if (qbr)
    {
        info(qbr .value());
    }
    
  • Verified answer
    Rustem Galiamov Profile Picture
    Rustem Galiamov 8,072 on at
    RE: Get grid filtered value

    Hi guruprasanna!

    This is how to get filter values:

    Query       query = InventTable_ds.queryRun().query();
    QueryFilter queryFilter;
    int         i;
    
    for (i = 1; i <= query.queryFilterCount(); i++)
    {
        queryFilter = query.queryFilter(i);
        info(strFmt("%1: %2", queryFilter.field(), queryFilter.value()));
    }

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans