Wednesday, 9 December 2015

Filtering the data(record) based on selected Input in Ax

For filtering a particular record    :


1.First create a table  i.e TableName   with fields name , Ids(Base enum) ,  Phno , Age

2.Create a form and drag the table 
TableName into data source.
in design take a grid and a combo box   give enum type as baseenum 

3.In class:
       public class FormRun extends ObjectRun
       {
             QueryBuildRange qbr2;  //  declartion of range variable
       }
4.In Data source level . Override a method init()
  1. public void init()
    {
          super();
         qbr2 = this.query().dataSourceName(“Datasourcename”).addRange(fieldNum(TableName, BaseEnum1));
    }
5.in combo box – in methods override a selectionchange method()
        public int selectionChange()
        {
               int ret;
               ret = super();
               
datasourcename_ds.executeQuery();
               return ret;
        }
6.Create a range by  overriding method executequery() in data source level: 
       public void executeQuery()
       {
           qbr2.value(comboboxName.valueStr());
           super();
       }
Note
     Set Auto Declaration :Yes for Combo box


1 comment: