The Info Class has a very special place among the classes provided by the AOT to work with. It is a framework class that mainly deals with the information, warning, or error messages shown by the AX client, Infolog in other words. All the infolog messages displayed on the AX client are constructed using the Info class.
However the InfoLog also has methods and attributes to handle the Dynamics AX workspace window. This post will describe a few cases where the Info class can be used besides creating and displaying an infolog. The most obvious one being the target of this post: Show the active configuration in the main window title bar.
However the InfoLog also has methods and attributes to handle the Dynamics AX workspace window. This post will describe a few cases where the Info class can be used besides creating and displaying an infolog. The most obvious one being the target of this post: Show the active configuration in the main window title bar.
As we discussed in a post earlier, we needed to have the same client connected to various server configurations. And we created multiple shortcuts of the client, and using command line parameters, appended the regConfig command with each shortcut's Target property and their you go, same client with two different shortcuts connecting with two different server configurations.
However, since the client is the same, we needed to have some text value or string representing each client's active configuration so that we can comfortably identify which instance we are currently working on. This can help a lot while working on both the environments side by side. Here comes the Info class to play.
We need to append the active configuration name with the window title. And we all know their should be no rocket science involved in it and their is none.
A child's look at the Info Class :)
Dynamics AX 2012 > AOT > Classes > Info: A child's look :) |
We see that the class contains a few methods that are triggered on the respective events. We are mainly interested in the workspaceWindowCreated method.
This method is executed when the workspace window is created. And we have an integer _hWnd handler parameter through which, we can refer to the created window. All we need to do is to add the following lines to the code;
void workspaceWindowCreated(int _hWnd) { super(_hWnd); // Put workspace window specific initialization here. WinAPI::setWindowText(_hWnd, WinAPI::getWindowText(_hWnd) + " - " + xInfo::configuration() + ""); }
Links
A few interesting links about the Info class that I could google out are provided;https://community.dynamics.com/ax/f/33/p/5512/41409.aspx
https://community.dynamics.com/ax/f/33/t/93579.aspx
0 comments:
Post a Comment