Posts Tagged ‘Ax 5.0 (2009)’
Change the language at runtime
Normally when you change your language you go to your user options, change your current language and the restart the client. This week I got the question if it was possible to do so in runtime. You can do so by just calling the infolog.language(str 7 _languageCode). All labels that you load after calling this method will be translated to the new language. (more…)
Amount in words
This week one of my customers asked me to place the amount in words on a invoice. I couldn’t believe that sush function wasn’t availible in standard Ax. After some research I found that the Global-class contains the following methods:
- static TempStr numeralsToTxt(real _num)
- static TempStr numeralsToTxt_EN(real _num)
- static TempStr numeralsToTxt_ES(real _num)
- static TempStr numeralsToTxt_FR(real _num)
- static TempStr numeralsToTxt_NL(real _num)
Portal development
While surfing the web, I came across a blog from 2 friends (Youri De Brabandere and Christof Decraene) about Enterprise Portal development. For the moment they have only a few posts, but I’m sure their will be more soon.
Have fun with the http://www.axepclipboard.com.
Ax Security got lost
At one of the customers I’m currently working they took the decision to take a look at the spaghetti of security keys. We made a plan of how the new basic security-structure should look like and implemented it. After releasing this new more logical security structure we started to get the message ‘%2 %1 not initialised.‘.
After some research we discovered this issue occurred only with a few user groups and that the message only exists in the KTD-files, so it is kernel related. We checked the AccessRightsList-table for some inconsistencies but no luck. In the end we found a work-around that helped us solving this issue. When we make a export of the security and afterwards we import the export we just made, the issue disappeared by itself. Because there are a lot of user groups that could be infected with this issue, we automated this fix by running the import – export in a job.
Where are breakpoints stored in Ax 2009
In Ax 2009 breakpoints are stored in 2 tables, the SysBreakpointList and the SysBreakpoints table. You can find those tables in the SQL Management Studio or in the AOT under System Documentation -> Tables. This is useful to know when you get ‘ghost-breakpoints’. My debugger started showing me older breakpoints from classes that were running in batch. What ever I tried, the breakpoints couldn’t be removed, even restarting the AOS made no difference. When you remove your (or all) records in both tables and restart your client/aos the ‘ghost-breakpoints’ were gone.
Enterpris Portal – Tips & Tricks (part1)
Ilearned something new from my colleague Koen Van Hauwenhuyse. He showed me 2 extra querystring parameters you can add tot the portal URL so the content will be shown different.
The normal Url of the page: http://***/TSTReplacement.aspx?WCMP=TST

The Url for the rolecenter-view of the same page: http://***/TSTReplacement.aspx?WCMP=TST&RUNONCLIENT=1

The Url for the same page without any navigation: http://***/TSTReplacement.aspx?WCMP=TST&NONAV=1

How to make methods on fields disappear (aka a bug)
Me and some of my colleagues are currently working with a customer on a Ax 2009 SP1 RU4. The other day we came to the conclusion that the modified methods on fields in a form suddenly disappeared. I know, you should write as less as possible code on a form, but sometimes there is no way around this.
After some research we found a reproduction how these methods suddenly disappeared:
- Go tot the AOT and chose a form
- Open the [FORM] -> Data Sources -> [TABLE] -> Fields -> [A FIELD] -node
- Add a method (for example the modified-method)
- Save your form
- Go to the properties of the table in the datasource
- Place your cursor in the table property (properties window)
- Push ENTER
The result is that the table will be reloaded in the form and all methods you created on the fields will be gone. So here you have another reason why you shouldn’t write lots of code on your forms. You can only lose it by accident.
Records with RecId 101090
I was using the postload method of the HRMBenefitType-table to fill the description-field with language-sensitive description (from LanguageTxt). This works fine when I view the record, but not when I use a lookup.
I’ve put a break-point on my postload method and noticed the recId (this.recid of the HRMBenefitType table). This is always the 101090. When I check this in the tablebrowser, this does not match the actual RecId valule.
I checked the SQL-trace-log and noticed the following instruction:
SELECT A.HRMBENEFITTYPEID,A.DESCRIPTION,A.RECVERSION,101090 FROM HRMBENEFITTYPE A WHERE (DATAAREAID=?) ORDER BY A.DATAAREAID,A.HRMBENEFITTYPEID OPTION(FAST 1)
The solution to this problem is simple. Just change the CacheLookup property to EntireTable and the strange behaviour of the RecId-field stops.
Enterprise Portal – titlebar issue (part 2)
While I was checking my previous Enterprise Portal titlebar issue, me and my colleagues found a second bug. When you use a single quote (‘) in the PageTitle, the name of the Page Defenition object is displayed instead of the actual label with the singel quote. We couldn’t find a solution yet, but we’re still looking.
Anyone any idea?
Enterprise Portal – titlebar issue
When you modify the PageTitle property of a new Page Definition to a label with a ‘special’ character in it. You will see that the title is not rendered well. For example when you use a é it will be rendered as é. I logged this case with Microsoft and for the moment there is no fix for this issue, but they suggested a simple workaround.
Workaround:
When you edit your page in Sharepoint, you can remove the ‘Dynamics Page Title Web Part’ and replace it by the old ‘Page Title Web Part’
Explanation:
The reason why there are two Web Parts is mainly the “Page Title Web Part” is the old Web Framework (Dynamics AX 4.0) – and rendering takes part in X++ code while “Dynamics Page Title Web Part” is implemented completely in C#.
(Source: Microsoft)


