Wednesday, 17 June 2015

Call Multiple report on single click in X++, Code for apply Range on From


I am writing this post to demonstrate how to call multiple X++ report on single click in Microsoft Dynamics AX 2009/2012. 


Call Multiple report on single click in X++


void clicked()
{
    Args args = new args();
    ReportRun       reportRun;
    ;

    args.record(PurchTable);
    args.name(reportstr(Report1));
    reportRun = classFactory.reportRunClass(args);
    reportRun.init();
    reportrun.run();
    args.name(reportstr(Report2));
    reportRun = classFactory.reportRunClass(args);
    reportRun.init();
    reportrun.run();
    args.name(reportstr(Report13));
    reportRun = classFactory.reportRunClass(args);
    reportRun.init();
    reportrun.run();
    super();
}


I am writing this post to demonstrate provide rangle on Form in Microsoft Dynamics AX 2009/2012 and best practices to apply range on Form Datasource executeQuery.


public void executeQuery()
{
    QueryBuildDataSource    qbdRGDetail;
    QueryBuildRange         qbrECCNumber;
    QueryBuildRange         qbrNumberSequence;
    ;

    qbdRGDetail = TableName_ds.query().dataSourceTable(tablenum(TableName));
    qbdRGDetail.clearRanges() ;

    qbrECCNumber = SysQuery::findOrCreateRange(qbdRGDetail, fieldnum(TableName, ECCNumber));
    qbrECCNumber.value(TableName2.ECCNumber);
    qbrNumberSequence = SysQuery::findOrCreateRange(qbdRGDetail, fieldnum(TableName, NumberSequence));
    qbrNumberSequence.value(TableName2.NumberSequence);

    super() ;


}


No comments:

Post a Comment

Import General journal from excel in D365 F&O

 Hi Guys, Import General journal from excel in D365 F&O Code:  using System.IO; using OfficeOpenXml; using OfficeOpenXml.ExcelPackage; u...