[AX 2012] How to filter forms records?

Hi,

i’ve got a single table holding records of two kind, the difference is in a field “category”, it can be “CAT A” and “CAT B”.

Now, i’ve got two different forms which retrieve data from the same table, but form 1 is supposed to display only “CAT A”

records, and form 2 only “CAT B” ones.

How do I achieve this the best? Do i have to use a query as data source for my form? Or can it be done via X++ inside

the form’s init() method?

thank you in advance

regards

hi

u can uses the querybuildframework

thnks,

srikanth

Add the query as a method to the datasource you are filtering the data on within the form, you need to use init() as well as you said.

How do i add the query to the form’s datasource via X++ ?

Thank you for your help

u need to write the code …

Right-click methods and then add a new method

Then as Srikanth said then write the code for your query and modify Init()