Posts

Showing posts from September, 2014

Show user name in Client Startup

I will provide you document in which I have mentioned how to show user name at the time of client startup. User name as a startup message

Retrieve underlying SQL Query.

Today I will demonstrate you that how you can retrieve underlying SQL Query in AX. static void Sqlcodestatement(Args _args) { CustTable cust; select generateonly forceliterals cust where cust.AccountNum=="1102"; info(cust.getSQLStatement()); } generateonly:- is a keyword which allow you to find the underlying SQL query in X++ query statements.

Retrieve BaseEnum Value through code

Today I will demonstrate you that how to retrieve BaseEnum v alue through code in AX. static void RetreiveEnumValue(Args _args) { DictEnum denum; int i; denum=new DictEnum(enumName2Id("ABC")); for(i=0;i<denum.values();i++) { print denum.index2Label(i); print denum.index2Value(i); } pause; }

QueryBuildLink Class

Today I will demonstrate you that how to use QueryBuildLink  Class in AX. static void querybuildlink_example(Args _args) { Query query = new Query(); QueryBuildDataSource custTableQBDS, custTransQBDS; QueryBuildRange qbr1; QueryBuildFieldList qbFl, qbF2, qbF3; QueryBuildLink qbl; QueryRun qr; CustTable custTable; CustTrans custTrans; custTableQBDS = query.addDataSource(tablenum(custTable)); custTableQBDS.fields().dynamic(NoYes::No); qbFl = custTableQBDS.fields().addField(fieldNum(CustTable, AccountNum)); qbF2 = custTableQBDS.fields().addField(fieldNum(CustTable, InvoiceAccount)); qbF3 = custTableQBDS.fields().addField(fieldNum(CustTable, CustGroup)); qbr1 = query.dataSourceTable(tableNum(CustTable)).addRange(fieldNum(CustTable, AccountNum)); qbr1.value(SysQuery::value('1102')); custTransQBDS = custTableQBDS.addDataSource(tableNum(CustTrans)); custTransQBDS.relations(true); qbl = custTransQB

QueryBuildDynaLink Class

Today I will demonstrate you that how to use QueryBuildDynaLink Class in AX. static void querybuilddynalink_example(Args _args)  { Query query = new Query(); QueryBuildDataSource custTableQBDS; QueryBuildDynalink qbdl; QueryRun qr; CustTable custTable; CustTrans custTrans; custTableQBDS = query.addDataSource(tablenum(custTable)); select firstonly custTrans where custtrans.Voucher == 'SIV-100015'; custTableQBDS.addDynalink(fieldNum(CustTable, AccountNum), custTrans, fieldNum(custTrans,AccountNum)); qr = new QueryRun(query); while (qr.next()) { custTable = qr.get(tableNum(CustTable)); setPrefix( 'Customer – ' + custTable.AccountNum); info(custTable.CustGroup); info(custTrans.Voucher); } }

Foreign Key Relationship

Today I will provide you document in which I have mentioned how to create Foreign Key Relationship between two tables. Foreign Key Relationship

Computed Column in View

Today I will provide you document in which I have mentioned how to create Computed Columns in Views . Computed Column in View