[ ax2012 ] SO charge code

– charge code is for the whole invoice

– register charge code in SO, then invoice, after that the charge code is post to that invoice and charge code in SO is disappeared.

– when we issue another invoice, we have to enter the charge code again.

– to keep the charge code, tick `Keep` in Charges form


[ ax2012 ] dynamics protocol

Access to protocol dynamics://


(Default)       =”URL:dynamics link”

URL Protocol=””


(Default)         =”path\to\AxHLink.exe %1″


ref : http://stackoverflow.com/questions/3468000/problem-setting-up-custom-url-protocol-on-windows-ce

NOTE: to open RemoteApp ( .rdp ), use mstsc command, for example

(Default) = mstsc.exe "D:\AXHLink.rdp"

or if we would like to pass parameter, just use the simple batch file and point the link to batch file


(Default) = D:\AXHLink %1

batch file that append `remoteapplicationcmdline:s:`

@echo off
copy D:\\AxHLink_Template.rdp D:\\AxHLink.rdp
echo %* >> D:\\AxHLink.rdp
call D:\\AxHLink.rdp

[ ax2012 ] Some Form of Some User crash


– User can open AX Client

– but cannot access some form

– while another user can access the same form

Root cause

This is because of the Personalized setting. ( User may add some fields etc. to make the form crash )


– File > Tools > Options

– Usage Data

– Form setup

– remove all the rows that related with this form

[ Microsoft Dynamics AX 2012 ] CIL generation: Source array was not long enough. Check srcIndex and length, and the array’s lower bounds


CIL generation: Line Number nn - Line Number nnn - Source array was not long enough. Check srcIndex and length, and the array's lower bounds.    \Classes\WhateverClass\WhateverMethod    nn    whatever    Err:nnn


On the Internet, there’s always a suggest to do a magic trick ( `Generate Full CIL` ) that solved all the symptom of Dynamics AX.

However, In my case, the `Generate Full CIL` does not help.

Scenario 1

In my case, The AX throws error `Source array was not long enough. Check srcIndex and length` and AX point the red underline error to class A,

A — use —> B


indicate error

However, the root cause of the error is in class B that is used by class A. The class B has compile error. ( I knew this by compile class B again, and found that some fields that is used in class B are missing from the table ).

After comment it out, recompile class B, and `generate increment CIL`. The error `Source array was not long enough. Check srcIndex and length, and the array’s lower bounds` is gone.

NOTE here that I don’t need to `generate full CIL` at all.

Scenario 2

I also found that, in some case AX indicates error in class A with `Source array was not long enough. Check srcIndex and length`, which class A use class B that extend from class C.

A —- use —-> B ( extends C )


indicates error

The root cause of the error is in class C. The class C has a compile error. The solution to this is like scenario 1, compile class C, and `generate increment CIL`. And again, no need to `generate full CIL`.

That’s it. Hope this article will help you, rather than waiting 4-5 hours doing nothing for the `full CIL generation` and ends up with same error as before. Try to check the modified class that the error class is used, they may contains error.

Steps to rules all of theses

In scenarios 1-2 we can knew the error class. However, in the case that we don’t know the error class. Following these steps to rule them all.

1. full compile AX  ( *** This is important, generate full CIL alone does not solve the problem )

2. fix all the compile error (  AX don’t allow us to deploy the new assembly if we had a compile error )

3. full generate CIL ( Some AX service group uses the CIL.NET assembly, so we have to generate CIL)

Once we can deploy the new .NET assembly, the problem is gone.