preloader-matrix

Alfasith

Controller Class in Dynamic AX

Controller Class
public static CustController construct(Args _args)
{
    CustController controller=newCustController();
    controller.parmArgs(_args);
    return controller;
}
/**********************************************************************/
public static voidmain(Args _args)
{
    CustController controller = newCustController();
    controller.parmReportName(#ReportName);
    controller.parmArgs(_args);
    controller.setRange(_args, controller.parmReportContract().parmQueryContracts().lookup(controller
.getFirstQueryContractKey()));
    controller.parmShowDialog(false);
    controller.startOperation();
 }
/****************************************************/
public boolean showQueryValues(str parameterName)
{
    return true;
}
/*****************************************************/
public void setRange(Args _args, Query _query)
{
    QueryBuildDataSource qbds;
    QueryBuildRange qbr;
    if (_args && _args.dataset())
    {
        switch(_args.dataset())
        {
            case tableNum(CustTable) :
                CustTable = _args.record();
                break;
        }
    }
    qbds = _query.dataSourceTable(tableNum(CustTable));
    qbds.clearRanges();
    qbr = qbds.findRange(fieldName2id(tableNum(CustTable),fieldStr(CustTable, AccountNum)));
    if (!qbr)
    {
        qbr = qbds.addRange(fieldNum(CustTable, AccountNum));
    }
    if(CustTable)
    {
        qbr.value(CustTable.AccountNum);
    }
}
/**********************************************************/
protected void prePromptModifyContract()
{
      super();
}
/************************************************************************/
class CustController extends SrsReportRunController
{
    #define.ReportName(‘CustReport.PrecisionDesign1’)
    SRSRDPCustTableContractClass sRSRDPCustTableContractClass;
    CustTable custTable ;

 }

Leave a Reply

Your email address will not be published.