Filter data based on Selection in Ax


To get data based on the selection of dates/enum values, we can use the below process to get the accurate data. The same logic can be used while opening the from as well.

1. declare a variable in “class declaration”

Mzk_monthYear      month;

2. to get the data filtration while opening form, assign the value for the above declared variable in init() of form

month = mthofYr(today());

3. build the query in data source level init() method


queryBuildRange = Mzk_JapanesPayrollEntry_ds.query().dataSourceTable(tableNum(Mzk_JapanesPayrollEntry)).addRange(fieldNum(Mzk_JapanesPayrollEntry, Mthyr));

4. pass the value to the query in “executeQuery()”



5. to get the data based on any filtration, assign the value of the global variable in modified method of the field at form DS level.

month = monthyear.selection();


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s