Wednesday, 16 March 2016

How to debug SSRS report RDP model in AX 2012

1. Verify whether you checked Enable break points, enable global breakpoints on server

2. Simply keep breakpoint; in your code
3. If that is not worked, then
    a. In class declaration extend SrsReportDataProviderPreProcess instead of                 SRSReportDataProviderBase
   b. Make changes of Temperory table properties as below
       i. Table type --> Regular
       ii. CreatedTransactionId --> Yes
4. Add below line in process method of DP class
    Temptablename.setConnection(this.parmUserConnection());

Happy Daxing.....

Lookup() and jumpref() methods in AX 2012

1. Lookup method we can write at table level, form Data source level and Form control level.
Now writing at Data source level(Form: Organization hierarchy, Table: Organization hierarchy)

public void lookup(FormControl _formControl, str _filterStr)
{
    SysTableLookup sysTableLookup =      SysTableLookup::newParameters(tableNum(DivisionTable), _formControl);
    Query query = new Query();
    QueryBuildDataSource qbds,qbds1;


    sysTableLookup.parmQuery(query);
    sysTableLookup.addLookupField(fieldNum(DivisionTable, DivisionCode));
    sysTableLookup.addLookupField(fieldNum(DivisionTable, DivisionName));
    qbds = Query.addDataSource(tableNum(DivisionTable));
    qbds1 = qbds.addDataSource(tableNum(DivisionCompanyLine));
    qbds1.relations(true);
    qbds1.addRange(fieldNum(DivisionCompanyLine, DataArea)).value(OrganizationHierarchy.Company);

    sysTableLookup.parmQuery(query);
    sysTableLookup.performFormLookup();
}

2. Writing jumpref() at Form DS level

public void jumpRef()
{
    Args            args;
    MenuFunction    menuFunction;
    ;
    args = new Args();
    menuFunction = new MenuFunction(menuitemDisplayStr(MenuItemName), MenuItemType::Display);
    args = new Args(menuFunction.object());
    args.caller(element);
    menuFunction.run(args);
}