Tuesday, May 31, 2011

Spell Check in Dynamics AX

There is a class in AX that allows to perform spell checking. This class uses Microsoft Word spell checker to do the validation. So, in order to use it, Microsoft Word should be installed together with proofing language pack. Because of this requirement it is also important to consider where to run spell checking - on the server or on the client.

public static server void spellCheckerTest()
    SysSpellChecker sp = SysSpellChecker::newLanguageId('en-us');

    info(strfmt('%1', sp.checkSpelling("behavior")));
    info(strfmt('%1', sp.checkSpelling("behaviour")));

The output in infolog will be:

Development environment in AX 2012

It wasn't easy to decide from what to start. There are so many new features and they are so important and interesting! However, there is one feature that every AX 2012 developer will use for sure.

In AX 2012 the new development environment was introduced (click on the picture to enlarge).

Now IDE is separated from the application.

You can also notice the beautiful visual studio-like code editor and compiler output window.

Development tools are now much more accessible. Version control parameters, for example, do not require navigating 3-levels deep menu.

Development workspace can be started by typing
ax32 - development
from command line, or by
combination from the application or another development workspace.

Disable the AOT Icon

Restrict AOT icon access on Dynamics AX 

Sometimes we want to restrict the AOT icon access on Dynamics AX, but we don't know how to do it... Is there a way to do this...

In the user group permissions that we want to change, we are going to the 'security' view and setting the 'Development' security key to 'No access'.

Company Specific Color Code

Here, I explain you how to make a form color change in Dynamics AX based on the company that was logged in.

To do this, we need to create/override run() method in SysSetupFormRun class. 

Please refer to the following code sample below. 
It shows how to change the color to red or yellow based on the company KOE or CEE.

public void run()
    int red;
    int yellow;


    red  = WinAPI::rgb2int(255,0,0);
    yellow  = WinAPI::rgb2int(204,255,0);


        case "KOE":

        case "CEE":