Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics AX (Archived)

Filter Data in grid

(0) ShareShare
ReportReport
Posted on by 385

form1.JPG

These are the screenshots of wat i have created pls help in order to create a form to filter the data using the button click

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Filter Data in grid

    You are trying to run a code which is having syntax error

    and the code which you have written will not solve what you are looking for.

    you need to add range to the form datasource query

    and rerun the form datasource executeQuery() method

    Please verify and update us if you need any more technical help

  • Suggested answer
    Martin Dráb Profile Picture
    Martin Dráb 230,354 Most Valuable Professional on at
    RE: Filter Data in grid

    The error says that your clicked() method isn't compilable. It's because QueryRun() expects a Query object, not a select statement. Look at How to: Create Queries by Using X++ [AX 2012] to learn basics of the query framework.

    Nevertheless you shouldn't create a new query at all - if the form is set up as usual, it creates a query automatically and you merely want to add a range to filter what it returns. It might look like this:

    QueryBuildDataSource qbds = Employee_1_ds.queryBuildDataSource();
    qbds.addRange(fieldNum(Employee_1, EmpId)).value(queryValue(10));
    Employee_1_ds.executeQuery();

    Also note that AX 2012 already have a table for storing employees (HcmWorker).

  • Mohammad Raziq Ali Profile Picture
    Mohammad Raziq Ali 2,432 on at
    RE: Filter Data in grid

    Hi Shashank.m,

    Where is your Filter Control in the above image?

    You must use Filter control to filter the Grid, use it first, you can take TextBox control if you want to filter according to DepId field.

    Please let us know and if it helps, please verify the solutions.

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! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,354 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans