Thursday, October 29, 2015

AX 2012 : Filter form using any field value

 filter form using any field value


to display the field as dropdown add relation other wise you have to manually enter value to filter

public void executeQuery() //overrride form dataSource method
{
    this.query().dataSourceTable(tableNum(LTExecutequery)).clearRanges();


    if(LTExecutequery_ID1.valueStr()) //fieldname.valueStr() set autodeclaration true
    {

       this.query().dataSourceTable(tableNum(LTExecutequery)).addRange(fieldNum(LTExecutequery,ID)).value(LTExecutequery_ID1.valueStr());

        }
    super();
}

then goto contol
public boolean modified() //override modified
{
    boolean ret;

    ret = super();
LTExecutequery_ds.executeQuery(); //Table name
    return ret;
}

No comments:

Post a Comment

Table browser URL in D365FO

Critical Thinking icon icon by Icons8