I am trying to understand how Infolog works within Dynamics AX. I understand that the following code will display the text in the infolog window.
info(“Hello World!”);
I am aware that info is a static method on the Global class and therefore the method can be called by simply calling the name without actually specifying Global::
While looking into the method info in class Global, I noticed that it invokes infolog.add. Right-clicking on add and selecting the option Lookup Definition takes me to the method add in the class Info.
If the class in which the method add exists is named as Info, how is it being called from within Global::info() with the name Infolog?
The only logical conclusion that I can arrive at is that Infolog is an alias for the class Info. If that is correct, where is this alias defined in the AOT (Application Object Tree)?
I searched the AOT but found multiple references to the term Infolog but I couldn’t find anything that would directly relate to an Application or System class.
The response to the same question I posted on Microsoft Dynamics communities forum helped me to understand the code better.
Is Infolog an alias to the class Info? – Response on Microsoft Dynamics Community forum
Below shown code is from the static method
Global::info(). I failed to notice that call to methodaddusing the objectinfologis actually an instance method and not static.In other words,
infologis an instance of classInfo. After looking into the class Info, I found thestartupmethod. I kept a breakpoint to debug the code and found that this method is called whenever the AX client is opened. This method in turn calls another method namedinitBrowser. Within the initBrowser, the following code seems to initialize the global instance of Infolog using a windows handle.The above menthod
initializeInfologexists in the System classxInfo, which is the parent class of Info. Since I cannot look into the class xInfo, I assume that this is where the instance of classInfowith the nameinfologis being created.