evalBuf Function is a very strong API in X++. We can quite easily evaluate complex algebraic expressions given in string and the result is also given back in string. This API should be used along with CodeAccessPermission. The downside of using this API is that the code using this function is not supported in CIL.... Continue Reading →
AX 2012: Add dynalink in X++
Use the following code to add dynalink to the form datasource query: public void init() { super(); this.query().dataSourceTable(tableNum(MzkPurchTrackingDetailsTable)).clearDynalinks(); this.query().dataSourceTable(tableNum(MzkPurchTrackingDetailsTable)).addDynalink( fieldNum(MzkPurchTrackingDetailsTable, PurchId), PurchParmTable, fieldNum(PurchParmTable, PurchId)); } Where, First parameter is the source table field Second parameter is the destination table Third parameter is the destination table field
AX 2012: Refresh caller form datasource
The following code refreshes the caller form datasource from the calling form: void clicked() { Args arg = new Args(); FormRun formRun; ; arg = new args(formstr(YourForm)); arg.record(yourTable); arg.caller(this); formRun = classFactory.formRunClass(arg); formRun.init(); formRun.run(); formRun.wait(); formRun.detach(); YourTable_DS.reread(); YourTable_DS.rereadReferenceDataSources(); YourTable_DS.research(true); } 1. reread() - Rereads the current record from the database 2. rereadReferenceDataSources() - Rereads the reference... Continue Reading →
AX 2012: this vs element | When to Use What?
In X++ we often come across an issue that we are unable to access an object member (e.g. a form method) via this keyword. Instead we CAN access the same form method via element keyword. So what's the difference between them? The difference is of the scope. To understand how it works, let's assume that... Continue Reading →