preloader-matrix

Alfasith

Add filter control to the form in Dynamic AX

Hi,
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()
{
    super();
   
        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.
    queryFilter.value(element.design().controlName(“FormField”)
.valueStr());
 //FormField is the filter that you added for proving range value in form.
    super();
}
Hope now it filters good.
Regards,

Leave a Reply

Your email address will not be published.