Ax 2012

AOTfirstChild() doesn’t work on project

This code doesn’t print yes:

ProjectNode projectNode = SysTreeNode::getSharedProject().AOTfindChild('new');
 projectnode = projectNode.AOTfirstChild();
 if (projectNode)
 info ('yes');

This Does:

ProjectNode projectNode = SysTreeNode::getSharedProject().AOTfindChild('new');
 projectNode = projectNode.loadForInspection();
 projectnode = projectNode.AOTfirstChild();
 if (projectNode)
 info ('yes');

Use loadForInspection to get inside a AOT project.

Ax 2012

Blank error starting AX 2012 R3.

What to do when you open AX R3 CU9 and see this beauty. Empty error description.

Captureblank

The issue appeared due to difference in AX versions that were used for database (R3 CU10), and AOS (R3 CU8) .

Solution for this problem is to renew an AOS and client

You can ensure that you have the issue by finding issue description in the event viewer:

Object Server 01:  Fatal SQL condition during login. Error message: "The internal time zone version number stored in the database is higher than the version supported by the kernel (9/8). Use a newer Microsoft Dynamics AX kernel."
Ax 2012

Turn off CIL exectution for user from code in AX 2012

If you cannot open the user options from AX 2012 for some reason, but you have to uncheck “Execute Buisness operations in CIL” you can use this job :

static void SR_CreateProjects_subProjects(Args _args)
{
    #LOCALMACRO.FLAG_ExecBusinessOpsWithInterpreter (1 << 10) #ENDMACRO
     UserInfo userinfo;
     ttsBegin;
         select forUpdate userinfo where userinfo.id == 'Admin';
         userInfo.DebugInfo = userInfo.DebugInfo | #FLAG_ExecBusinessOpsWithInterpreter;
         userinfo.update();
     ttsCommit;
}