29 June 2018

Working with Queries 2 in AX 2012 and Dynamics 365

public Query queryBuild()
{
Query q;
QueryRun qr;
QueryBuildDataSource qbd,qbd1;

q = new Query();

qbd = q.addDataSource(TableNum(CustTable));
qbd1 = qbd.addDataSource(TableNum(CustTrans));
qbd1.addLink(fieldNum(CustTable, CustAccount), fieldNum(CustTrans, CustAccount));

return q;
}

public Query queryBuildHeader()
{
Query q;
QueryRun qr;
QueryBuildDataSource qbd,qbd1;

q = new Query();

qbd = q.addDataSource(TableNum(CustTable));

return q;
}

==
Query q = this.queryBuildHeader();

07 June 2018

How to get user input value in Controller class in AX 2012 D365


How to get user input value in Controller class in AX 2012 D365
How to get contract value and based on the user value condition run report design

class TestController extends SrsReportRunController
{
public static void main(Args _args)
{
TestController controller = new TestController();
controller.parmReportName(ssrsReportStr(StatementMan, report));
controller.parmArgs(_args);
controller.startOperation();
}

///
///
///

protected void preRunModifyContract()
{
TestStmtContract contract = this.parmReportContract().parmRdpContract() as TestStmtContract;
this.parmReportContract().parmReportName(this.getReportName(contract));
super();
}

private str getReportName(TestStmtContract _contract)
{
str reportNameLocal;

if (_contract.parmNoTrans()) // this is the user input value
{
reportNameLocal = ssrsReportStr(StatementMan, report1);
}
else
{
reportNameLocal = ssrsReportStr(StatementMan, report);
}

return reportNameLocal;
}

}

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension-...