Inside Microsoft Dynamics® AX 2009

AX

You can also download the sample codes used in this book and download the bonus content : Upgrade to AX 2009 from MS Learning website.

An eaxmple of List data structure in AX

static void ListSample(Args _args)
{
List list = new List(Types::Record);
Enumerator en ;

list.addEnd(333333);
list.addEnd(111111);
list.addEnd(222222);
en = list.getEnumerator();

while (en.moveNext())
{
print en.current();
}

pause;
}

Query “join table A with table B and table A with table C”

Query query = new Query();
QueryBuildDataSource qbds,qbds1,qbds2;
qbds = query.addDataSource(tableNum(CustTable));
qbds1 = qbds.addDataSource(tableNum(CustTrans));
qbds2 = qbds1.addDataSource(tableNum(CustLedgerTransTypeMapping));
qbds1.addLink(fieldNum(CustTrans,AccountNum),fieldNum(CustTable,AccountNum));
qbds2.addLink(fieldNum(CustTrans,TransType),fieldNum(CustLedgerTransTypeMapping,CustSettleTransType));

info(query.toString());

%d bloggers like this: