Add filter control to the form in Dynamic AX

Four method is to be added for achieving this feature in your form
1.  Add modified method the filter field (below code)
public boolean modified()
    boolean ret;
    ret = super();
        Table1_ds.executeQuery(); // Here Table1_ds is the datasource to be filetered
    return ret;
2.  Add QuerryFilter in global declaration of the form
public class FormRun extends ObjectRun
    QueryFilter queryFilter;
3.  Override the init method of the concern datasource where record to be filtered.
public void init()
        queryFilter = Table1_ds.query().addQueryFilter(Table1_ds
.queryBuildDataSource(), “FieldName”);
//Same as earlier Table1_ds is the data source and FieldName is the add range to the datasource query.
4.   At last add executeQuery for the same datasource.
public void executeQuery()
    // Get the filter value from the filter control.
 //FormField is the filter that you added for proving range value in form.
Hope now it filters good.

Leave a Reply

Your email address will not be published. Required fields are marked *