Thursday, 9 January 2014

Based on Menuitem filter the records on the form in ax 2009

public class FormRun extends ObjectRun
{
    QueryBuildRange qbr,qbr1;
}

public void init()
{

    super();
    qbr = this.query().dataSourceTable(tableNum(McsFedApplicationApprovalOrder)).addRange(fieldNum(McsFedApplicationApprovalOrder,CustCatGroup));
    qbr1 = this.query().dataSourceTable(tableNum(McsFedApplicationApprovalOrder)).addRange(fieldNum(McsFedApplicationApprovalOrder,CustCatGroup));
}


public void executeQuery()
{
    if(element.args().menuItemName() == menuitemDisplayStr(McsFedApplicationApprovalOrderHT))
    {

      qbr.value(enum2str(McsFedCustCatGroups::HT));
    }
    if(element.args().menuItemName() == menuitemDisplayStr(McsFedApplicationApprovalOrderLT))
    {

      qbr1.value(enum2str(McsFedCustCatGroups::LT));
    }
    super();
}

No comments:

Post a Comment