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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Create a form and display data in form using the textbox value

(0) ShareShare
ReportReport
Posted on by 385

I am a beginner. I would like to create a form and add a grid,a button and also a  text box and would like to filter the data in the grid using the value in the text box.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohammad Raziq Ali Profile Picture
    2,486 on at

    Hi shashank.m,

    -->Create Form by just right clicking at form nodes and drag your table in form datasource node.

    --> go to designs->design node in form, right click and select grid options and drag the fields from your datasource field node in your grid.

    --> similar way, you can drag text box by right click at design node.

    --> To filter the grid, please follow this link

    mfmujahidmim.wordpress.com/.../filtering-the-records-in-a-form

    If you need more help, please let us know.

    If this solution helps you, please verify it.

    Thanks,

    Raziq

  • Verified answer
    shashank.m Profile Picture
    385 on at

    Thanks Mohd Raziq Ali but  i have created a form and added the data source but when i open my form i am getting all the rows in tat data source and i am not able to filter the data in tat grid i think i have to write a x++ code but i am not getting any sample code to filter the data even using a query also

  • Verified answer
    Mohammad Raziq Ali Profile Picture
    2,486 on at

    Hi Shashank.m,

    That's good, all the rows of table populated in your form but you want to filter the data present in grid  .

    For this, you have to add filter which filters the data as per condition supplied in filter control.

    E.g., you have taken dateEdit control as your filter control and depending the value given, it must filter.

    It requires very little effort to achieve this and little code as well.

    --> Right the form, select View Code and add this code QueryBuildRange range; in class declaration.

    --> Now, come to DataSource level in form, select methods, override init method & the following code after super();

    range=this.query().dataSourceNo(1).addRange(fieldNum(YourTableName,Field));

    --> Override the executeQuery() method at same level i.e., DataSource level and following code after super();

    range.value(YourControlUsed.valueStr());

    --> Now, very important, override selectchanged() method at control level and add the following code

    int ret;

    ret = super();

    YourTableName_ds.executeQuery();

    return ret;

     

    You just follow my blog specified above and analyse the code, if you stuck anywhere, please let me know.

    if it helps, please verify the solutions.

  • André Arnaud de Calavon Profile Picture
    301,171 Super User 2025 Season 2 on at

    Hi shashank.m,

    As you marked some answers as verified and the same time asking a question, it is not clear if the question has been answered or not. Please only verify answers when you answer is really answered. If your reply does not contain a solution, please don't mark this as 'answered your question'. Can you unmark your reply as it does only contain a question?

    I think the details provided by Mohd Raziq Ali are correct and should help you. If not, here is an additional example form in AX where some filter fields are available. The form is called "ProdTableOverview".

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
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans