Skip to main content

Posts

Modal forms in Dynamics AX

Some years ago, I wrote on this blog of a method to make a form modal in the AX client. The solution was made on Axapta 3.0 and involved calling winapi unmanaged. Someone commented that the method I described was bad code, because he had experienced a computer crash while debugging something that involved the code. Mindaugas Pocius has suggested a method in his Dynamics AX cookbook books Dynamics AX Cookbooks where the windowtype is set to Popup. This ensures that the form is on top but not that the form you want to be modal, is the only one that is active, so using Mindagaus' method, you are able to leave the form that is "modal". Now a colleague of mine has found a very simple solution. His scenario was this. From a form you can click a button that opens an other form. This form that is opened must be ontop and the only form in focus and active until you either click OK or CANCEL in this form. The calling form includes a button, that open the form to be modal. The

Very small and simple tool to use when comparing code in different AX environments

Some time ago I was was given the task of determining the differences in codebase between three different AX environments, running AX 2012 RTM. You might ask why would this be necessary, if you follow best practices that code is always moved from DEV to TEST, from DEV TO STAGING, and from STAGING to PRODUCTION, the only differences would be new ? Well, sometimes it is just not possible to test and correct a data problem that the users have in PRODUCTION by having the data rolled back into DEV within the timeframe given to solve the problem, and this leads to someone making hotfixes in the code directly in PRODUCTION. I know, I know - NOT recommendable. However the situation was that noone was exactly sure that the codebase in the environments were aligned, and wanted to know if there were any differences and where. Enter Araxis Merge , which is a wonderful tool for comparing and merging text-files. The advantage Araxis has over Dynamics AX's own compare tool are several:

Showing hidden fields in the table browser

A request for the possibility of showing the contents of hidden fields in Ax tables, using the table browser, made me do a google search, to avoid reinventing the wheel. Sure enough Vilmos Kintera had adressed the problem earlier on http://daxrunbase.blogspot.dk/2010/04/non-visible-fields-in-table-browser.html. And he has done good work. :) Keep it up Vilmos. Running the customized table browser seemed to work fine in AX 2009, however I ran into issues using it in AX 2012. I tested the customized table browser on the table CustTrans, which was the table I first found to contain hidden fields and I got a run-time error. Investigating the problem I found that the reason in seemed to run fine on AX 2009 (using CustTrans table) but failed in AX 2012 on the same table, was due to a small issue that Vilmos hadn't adressed, namely Extended Data Types defined as Arrays. The .ds datasource on the SysTableBrowser form had it's active method customized to populate the new lower grid,
Yes I know it's small chance of ever winning, but if you don't play you have no chance of winning. Firebrand Training is giving you the chance to win free training for a life time, and who wouldn't want that as a price. :) Please click Firebrand Training to enter the competetion your self.

Fixed assets DAX 2012: Missing value models in lookup

Having trouble with missing value models in lookup in Fixed Assets module. Try running the class AssetRebuildTables The EDT AssetBookMergeId defines either a value model or a depreciation book. This EDT is related to a table called AssetBookMergeLookup. I experienced that this table had been "corrupted", so that one of the value models were not available in the lookup. I ran the AssetRebuildTables class from the AOT, and voila. The table was rebuilt for me.

Dynamics AX 2012 Excel Add-in document services and queries with missing relatios

While working on an assignment where I among other things had to prepare a new query for use with document services and the Excel add-in. The query consisted of three nested data sources, where two was standard tables and the third was a new table which I had added to the system. First version worked just fine. I exposed the query through document services and I could get data in Excel. The for some reason I decided to change the relations on the table I had added, for reasons that I forget. However suddenly my query was not showing up in the pick list, when I using the "Dynamics AX" / Add Data button i Excel. The reason ? I had messed up the relation from my new table to the standard table, making the relation empty. The Excel add-in reacts by simply not showing the now invalid query in the list, but it does not warn you that something is wrong. I got a clue to this, by trying to use "Add table" instead going directly for my new table. Then Excel add