Skip to main content

Posts

Showing posts with the label AX Forms

Calling/Opening AX form through X++

Sample piece of code to open AX form through X++ static void OpenForm_ThroughCode(Args _args) {     Args                            args;     Object                          formRun;     // open form     args = new Args();     args.name( formstr (FormName));     formRun = classfactory.formRunClass(args);     formRun.init();     formRun.run();     formRun.wait(); } If you want to pass a record to open a form args = new Args(); args.record(ProjTable::find('PR00001')); args.name( formstr (FormName)); formRun = classfactory.formRunClass(args); formRun.init(); ...

How to implement Runbase form in AX

Today I had a requirement that allow users to run Outlook synchronization process in batch rather sync it manually using out of the box functionality. Let's have a look on existing functionality and then extend it to achieve the requirement of running it in batch. Existing functionality in AX Home> Periodic > Synchronize [AOT form name is smmOutlookSyncrhonization ] As you can see someone has to manually sync outlook emails to AX acvitities or viceversa. Extended functionality in AX Let's implement this functionality in batch so users can set recurrence the Sync. Create a new class; class SyncOutLookEmails_RunbaseForm extends RunBaseBatch {     // Packed     TransDate            testDate; // I am using this variable for own testing purpose     #define.CurrentVersion( 2 )     #define.Version1( 2 )     #lo...

Cache display methods in AX 2012

Display methods must be written at the table level However, developers often write display or edit methods to perform some calculations and then bind them on form's controls to allow user to display or edit values in those bounded controls.  Display/Edit methods create excessive client-server round trips and impact on product performance. And if there are  display methods added on the form it will make 5 client-server round trips, one for each method. Options 1: CacheAddMethod This issue can be addressed by using the CacheAddMethod on the FormDataSource. This method enables the form to calculate all of the display methods in single round trip to the server rather making individual calls. Let's assume you have added edit method on ProjTable form to show some calcuated dates. Override init() method under ProjTable datasource and write following code; public void init() {     super();   ProjTable_ds.cacheAddMethod( tableMethodStr (ProjTable,...

Debug/Test SSRS report in AX 2012

People came across issues like report is not showing data on report or data is not per their expectation. It is really hard to judge where it goes wrong and what needs to be correct in which class RDP, Contract, UI or Controller. Following sample job can be used to debug SSRS report processing data and lead to find what goes unexpected. For more information about classes and table used in this example please read my previous post static void FF_ReportDPTest(Args _args) {     // temp table declaration     FF_ReportTmpTable       ffReportTmp;     // RDP class binded with FF_Report     FF_ReportDP             dataProvider = new FF_ReportDP();     // Contract class for report parameters     FF_ReportContract       contract = new FF_ReportContract(); ...

Run SSRS report from AX form

Continue from my previous post where I developed an example using all SSRS framework classes. One of them is controller class which is used to call SRS report from AX forms. Just for the note controller class is used for following purposes. Modifying a report query based on the input data Modifying report contract data based on the input data Control a report parameters dialog Open different reports/designs from the same menu item based on the input data Reports that are opened from a form Example; how to call report from AX form button/menuitembutton click void clicked() {     CustOpenInvoices        custOpenInvoicesLocal;     SrsReportRunController  controller = new FF_ReportController();     SrsReportDataContract   contract;     FF_ReportContract       rdpContractClass;   ...

AX 2012: Forms and Tables methods call sequence

Many a times we came across the point that where should we write code either it would be in init() of a form or in datasource init() method. And which method will be called first and where you can actually retireve record and what would be best way to accomplish few basic requirements without impacting the performance. For all above reasons I found an interesting link and thought it would be worth sharing here. http://www.slideshare.net/HamdaouiAmine/microsoft-dynamics-ax2012-forms-and-tables-methods-call-sequences-30159669#