Notifications
Announcements
No record found.
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
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
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
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.
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.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 4 Most Valuable Professional
Priya_K 4
MyDynamicsNAV 2