System administrators often need to know how many AX client sessions are connected to AOS server for multiple reasons: 1. View all the existing client sessions to AOS server 2. End existing client sessions to AOS server 3. Reject new client sessions 4. Accept new client sessions To perform such jobs, navigate to System administration >>... Continue Reading →
AX 2012: Creating enhanced inbound port
Prerequisites: 1. Full compile has been performed revealing no errors 2. Full CIL has been performed successfully 3. Incremental CIL has been performed after compiling the new service class To create an enhanced inbound port for your custom service, please follow the steps below: 1. Right click on the service node, CustomerService in this case,... Continue Reading →
AX 2012: Creating parm methods automatically
It is often a tedious task to create parm methods for a class having many data members. Use the following AOT job to create parm methods automatically instantaneously! All you need to do is to declare data members in the class declaration. Make sure the data type and variable is separated by a single space... Continue Reading →
AX 2012: Auto increment a field using LineNum
Do you want a line number field for your table just like we see the line numbers on SalesLine table on the Sales Order? if so then follow the steps below the achieve this functionality. 1. Drag LineNum EDT to the fields node of your table. 2. Create an index on your table and drag... Continue Reading →
AX 2012: Get SID of Logged-In User – whoami
Open command prompt and run the following command to get the SID of the current logged-in user:
AX 2012: Using Temporary Table as Form’s Datasource
First add a method on the form to populate records in the temporary table: public LabelsTable populateRecords() { SysDictTable dictTable = new SysDictTable(tableNum(PurchLine)); SysDictField dictField; TreeNode treeNode; LabelsTable labelsTableLocal; // Temporary table (InMemory) FieldId fieldId = dictTable.fieldNext(0); while (fieldId) { dictField = dictTable.fieldObject(fieldId); if (dictField.isSql() && !dictField.isSystem() && dictField.name() != "Modified") { treeNode = dictField.treeNode();... Continue Reading →
AX 2012: Loop through all the fields of a table in X++
This is how we can loop through all the fields of a table in X++: static void Job1(Args _args) { SysDictTable dictTable = new SysDictTable(tableNum(PurchLine)); SysDictField dictField; TreeNode treeNode; FieldId fieldId = dictTable.fieldNext(0); while (fieldId) { dictField = dictTable.fieldObject(fieldId); if (dictField.isSql() && !dictField.isSystem()) { treeNode = dictField.treeNode(); info(strFmt("%1 | %2 | %3", dictField.name(), // Field... Continue Reading →
AX 2012: evalBuf – Evaluate string expression in X++
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: Create a project from a specific layer
To create a project to include all the existing objects from a specific layer, perform the following steps: 1. Press Ctrl+Shift+P to open the Projects window 2. Right click the Private/Shared project node to create a new project 3. Open the newly created project in a new window 4. Click on the Advanced Filter/Sort button to... 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