In Microsoft Dynamics AX, you can sort a form datasource when the form is loaded. On the form, override the init method. After the call to super(), add the sort field to the form datasource. If you need to sort on multiple fields, keep adding the fields you need with the addSortField method.
In Microsoft Dynamics AX, you can apply a filter to a form datasource to show a subset of data from a table in a form. The executeQuery method is the one you need to look at. In the form datasource, override the executeQuery method. It’s located to \Forms\%FormName%\Data Sources\%DataSourceName%\Methods\executeQuery. Before the call to super(), add … [Read more…]