Default AX model for all users

If you want to set the default AX model for all of your active user accounts on a certain layer, you may run the following job to do so.

Whenever a new developer joins in, you may include running this job in your account creation process to make sure they do not try to check in code to the wrong place, but only to your correct default AX model.

Do not forget to change the layer and the name of the model.

static void WIK_UpdateDefaultModel(Args _args)
    UserInfo                userInfo;
    UserInfoStartupModel    userInfoStartupModel;
    UserInfoStartupModel    userInfoStartupModelDB;
    UtilEntryLevel          layer = UtilEntryLevel::cus;
    ModelId                 modelId = any2int((select firstOnly Model from SysModelManifest where SysModelManifest.Name == 'MyModel').Model);


    while select userInfo
        where userInfo.accountType  == UserAccountType::ADUser
        notexists join userInfoStartupModel
            where  userInfoStartupModel.UserId  ==
                && userInfoStartupModel.Layer   == layer
                && userInfoStartupModel.ModelId == modelId
        userInfoStartupModelDB.Layer            = layer;
        userInfoStartupModelDB.UserId           =;
        userInfoStartupModelDB.ModelId          = modelId;
            if (userInfoStartupModelDB.validateWrite())
                throw error('We have a problem');

    update_recordset userInfoStartupModel
        setting ModelId = modelId
        where userInfoStartupModel.Layer    == layer;


MSDN link for UserInfoStartupModel:

By |2015-12-22T14:47:21+01:00December 22nd, 2015|Categories: AX 2012|Tags: , , , , |1 Comment

AOT node compare

One of the most often used tool is the AOT node Compare utility, which has some improvements from the past but can be changed further.

Now in AX 2012 the compare tool can be executed as CIL code rather than in the X++ runtime tier, which should give you considerable performance boost for larger code comparison. Here is a great post (The compare tool–and running X++ code as IL) from mfp about improvements that Microsoft did.

On the other hand you can do some improvements yourself by adding the following line to the SysCompare class, selectionChanged method:


By |2015-11-23T17:54:27+01:00August 14th, 2012|Categories: AX 2012|Tags: , , , , , |2 Comments

Deep Best practice checks with layer filtering in compiler

You can (and should) enable best practice checks for the MorphX and X++ developer environment, which is similar to the dotNET FxCop code analysis tool. Though the standard Microsoft Dynamics AX 2009 code does not have any best practice errors, you can still find a lot of warning and info type problems.

Update: Microsoft just released a new version of the BP document, which is available here: Microsoft Dynamics AX 2009 Development Best Practices White Paper

To enable best practice checks, go to the menu under Tools/Options, then press the Compiler button on the right. You have to set Diagnostic Level 4 to enable the compiler to check your code for necessary and possible optimizations.


By |2015-11-23T18:00:52+01:00April 14th, 2010|Categories: AX 2009|Tags: , , , , , |0 Comments
Go to Top