How to filter records in form

Hi All,

I am new to AX.I need when i open the form it filters the

records & show me the records of today only(nt the records inserted before date).

In init how to write.

Thanks in ADV.

hi Sambit Mohapatra

  1. the field that u want to filter must be change Properties AutoDeclaration to True

  2. use this code in FirstField Method or Other Method : FieldName.filter(Today( ))

Take a look at smmTransLog Form for inspiration. (which has from date and to date, use single date in your case)

Please check with below code on init.

{

QueryBuildDataSource qbds;
QueryBuildRange CreatedDaterange;

super();

qbds = this.query().dataSourceTable(tableNum(“table_name”));

CreatedDaterange = qbds.addRange(fieldNum((table_name",CreatedDateTime));
CreatedDaterange.value(queryValue(today()));

}