Tools and tutorials for Microsoft Sustainability Manager, Microsoft Cloud for Sustainability, Microsoft Emission Impact Dashboard, as well as Microsoft Dynamics AX aka Microsoft Dynamics Supply Chain Management (F&O)
Code highlighting
Monday, October 26, 2009
Mock objects implementation for AX
But the only real test framework that comes with AX is the SysTest framework (you can read more about it here).
Below you will find another framework for Dynamics AX, that was written by one of the members on my test team and allows to implement and use mock objects for testing the AX application.
More information and download link
It would be great if you could try it out and provide your feedback here or directly on the author's blog.
Thursday, October 22, 2009
Running a class from AOT or "How to assign a class to an action menu item?"
But, in reality, I still now and then meet people who have worked with AX for quite some time, but don't know this very basic concept.
Therefore, I just want to briefly describe it here to refresh everyone's memory
Apart from allowing to run the class from AOT, this will allow to assign it to a menu item (according to Best Practices, it should be a menu item of type Action), and run the class using this menu item.
Below is the correct syntax of the main method:
public static void main(Args _args)
{
//Your code here
}
Please also note, that there is an editor script that contains the template for the main method. You can invoke it from Scripts->template->method->main
Monday, September 28, 2009
New AX blog in da house
He has recently started translating them to English and posting on his web-site, http://fedotenko.info/.
I highly recommend all of you to visit the link above and read the articles already posted there.
Monday, August 24, 2009
“Go to main table” on a RunBase dialog control
In one of my blog posts, I have been posed with the following question:
“how to achieve go to main table on dialog field.
for example a dialog is having a field of lookup custAccount, now what i need to have a go to main table functionality on the same.”
So, the short answer is: It is not possible to override jumpRef method directly on the dialog control. This is due to the fact that in order to show the “Go to Main table” link in the context menu of a control, you need to actually override that method on the form, which is later used to draw the context menu.
There are 3 possible ways that you can achieve the same functionality though, that I would like to briefly discuss here:
- Recommended Don’t bother with the dialog. Simply create a form, and override the jumpRef method on the needed control on the form. To demonstrate this behavior, you can use the Tutorial_RunBaseForm class and form. Override the jumpRef method, put the code to call the main form there. And you are done. Simple, and does not require a lot of coding. There is a lot of confusion, where junior AX developers think it will require a lot of code changes to replace a dialog with a form. This is not entirely that hard, as RunBase classes can use a regular AOT form instead of the regular dialog.
- Use controlMethodOverload approach, and create the controlName_context() method, which is executed when you try to open the context menu on the specified control. Inside this method, build the context menu from scratch. This way, only the items you want to be shown will be present in the context menu. Note: this means, that standard context menu items, like Setup, will not be shown in the menu (unless you add and handle them).
- Use controlMethodOverload approach, as in the previous example, but instead of overriding context() method, override the showContextMenu method. This will allow you to add your custom context menu items to the standard context menu. This does not seem to work on Axapta 3.0 though, and I did not try to figure out why. Note you need to uncomment some code in order to enable this approach (I left a TODO comment for that).
I have made the necessary changes, demonstrating the latter 2 approaches, using the class located under Classes\Tutorial_RunBaseBatch. You can download the xpo here (it contains only the USR layer changes).
The class used for drawing the context menu in the example is called PopupMenu. A good example of how this class can be used in the application is available in AOT under Forms\Tutorial_PopupMenu. Some information, along with another example, is available on MSDN.
A while ago, I have suggested some minor changes to the Dialog framework classes, which allow to simplify the process of overriding control event methods on the dialog. The original post can be found through this link: http://kashperuk.blogspot.com/2007/06/3-dialog-extensions.html
Let me know if any of this requires more clarification.
Inside Dynamics AX 2009 – Russian Translation
As you all know, Microsoft has recently released another book on development in Dynamics AX, called Inside Dynamics AX 2009.
For the past 2.5 months, I have been working on the Russian translation of this book, and now I am glad to say that the translation is over and will soon hit the shelves of online-stores. I guess it will also be available directly from Microsoft Russia, similar to the 4.0 version.
The book has gained a lot in weight :) and content. With more than 200 new pages, as well as many changes and updates of the existing chapters, the book is definitely a good investment. New “hot” features of Dynamics AX, like SSRS reports, Workflow, Role centers, etc., are described in the book from a developer point-of-view.
I really hope that my effort will not go in vain, and the book will be helpful to people working with Microsoft Dynamics AX 2009.
Thanks