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: Add financial dimension for your table
Lets quickly take a look at how the financial dimensions framework has been redesigned in AX 2012. The following picture show the table design: To add a new financial dimension for your custom table, perform the following steps: 1. Drag the EDT (AOT >> Data Dictionary >> Extended Data Types >> DimensionDefault) to the fields... Continue Reading →
AX 2012: How to open a form in X++
Using FormRun: void clicked() { Args args; FormRun formRun; args = new Args(formstr(CustTable)); args.record(custTableLocal); formRun = classFactory.formRunClass(args); formRun.init(); formRun.run(); formRun.wait(); formRun.detach(); CustTable_DS.research(); } Using MenuFunction: void clicked() { Args args; args = new Args(); args.caller(this); args.parmObject(list); new MenuFunction(menuItemDisplayStr(SalesTable), MenuItemType::Display).run(args); }
AX 2012: Manual Charges
Once you have setup Charges Codes, you can add manual charges to Sales Order (SO) or Purchase Order (PO). The question is why do we need to add charges manually to orders if we have the auto charges functionality? Typically we add manual charges to an order if it is not a regular one, which... 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 →
AX 2012: Create lookup in X++
To create a lookup on a control (e.g. StringEdit control), override the lookup method of that control and copy paste the following code snippet in it. Of course, you will need to substitute datasource of the query according to your requirements. public void lookup() { Query query; QueryBuildDataSource datasourceModule; QueryBuildDataSource datasourceLanguage; QueryBuildRange rangeElementType; QueryBuildRange rangeModuleId;... Continue Reading →
AX 2012: Windows Save File Dialog in X++
If you want to open the standard Windows Save File Dialog from X++ and let the user select the path of the file to save to, then you can use the following code: This code opens the following dialog:
AX 2012: Charges Codes
Before you plan to add manual or automatic charges when you create a sales or purchase order, you must setup Charges Codes. They are used to define the kind of charge and how the charge is going to be debited or credited. You can setup charges by navigating to Setup → Charges → Charges codes in the... Continue Reading →
AX 2012: All about Batch processing
In this post, you can learn about the following: 1. Batch Server Configuration Learn about how to set maximum no. of threads and their scheduling. Indicating which AOS instances are batch servers and which are load balancers. 2. Batch Group Configuration Learn how to configure batch groups. Select AOS instances available for your batch job. 2.... Continue Reading →