Search This Blog

Tuesday 13 August 2013

Modifying the Form DataSource Query in Microsoft Dynamics AX 2012

Hi its quite easy  in Microsoft Dynamics AX to modify the query of the form on some scenarios.

Like there is the scenario in which i want to show all number of positions when user click the assign button and shows only those positions which have cost element assigned  when the user clicks the update button.

Just consider the scenario when the user clicks the assign button.
The below form is open containing all the forecast positions inside the grid.















And when the user click the update button only those positions will be shown which have cost element assigned.

As you can see in the image below.














This change is just because of we have override the datasource init method and modified the query.

Just go to the form datasource on which you want to modify the  query in my case i have hcmpositionforecast datasource.

Just go to the its datasource methods and than right click and than override the init method.

inside that method write the form datasource query and than modify it based on your scenario.As you can see this in the image below.













Thanks

Muhammad Zahid.