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 … Continue Reading
Archives
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 … Continue Reading
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. … Continue Reading
System tables – part1
In this post I will talk about some Ax kernel tables that are automatically created after the setup at the first run of Ax. They are typically company independent (no DataAreaId) and contain some valuable information about AX. You can find the tables I wil discuss under the AOT –> System Documentation –> Tables. AccessRightsList … Continue Reading
Batch job performance boost
Did you ever have trouble with the performance of your batch-job? Well maybe this small trick can shorten the time your batch runs. The big idea: Try to split up your gigantic batch in smaller pieces. Launch a batchjob that produces many smaller batchjobs (tasks) that can handle a subset of the data you need to … Continue Reading
Expressions in query ranges – limitations
When you want to construct a query-object that contains OR-conditions, you can construct something like this: 1 2 3 4 5 6 queryBuildRange.value(strFmt('((%1 == %2) || ((%1 == %3) && (%4 == "%5")))’, fieldStr(InventTable, ItemType), any2int(ItemType::Service), any2int(ItemType::Item), fieldStr(InventTable, ProjCategoryId), queryValue("Spares")));queryBuildRange.value(strFmt(‘((%1 == %2) || ((%1 == %3) && (%4 == "%5")))’, fieldStr(InventTable, ItemType), any2int(ItemType::Service), any2int(ItemType::Item), fieldStr(InventTable, … Continue Reading
Test if a configuration key is enabled in X++ code
How do you execute code when a Configuration key is enabled? It is pritty easy. Ax x++ has a build-in function ‘isConfigurationKeyEnabled’, witch you can use to check a configuration key. Small example: if (isConfigurationKeyEnabled(configurationkeynum(AIF))) { // Do something… }if (isConfigurationKeyEnabled(configurationkeynum(AIF))) { // Do something… }
List of mandatory fields on a table
When you want a list of all the mandatory field on table X, yould check all the properties on the table fields, or you could be lazy and write a small job that does the trick for you. Just replace TableId with your tablenum. 1 2 3 4 5 6 7 8 9 10 11 … Continue Reading
Code Editor – shortcuts
Underneed you find the list of shortcuts I use most in Microsoft Dynamics Ax while developing. General (shortcuts I also use outside AX) CTRL + S : Save. CTRL + C : Copy text to clipboard. CTRL + X : Cut text to clipboard. CTRL + V : Past text from clipboard. CTRL + A : … Continue Reading
Working with numbersequences – On forms
When you want to implement NumberSequences in a Ax form (new numbersequence when you create a record etc.) you can just implement the ‘numberSeqFormHandler’. Step-by-step: