Posts

Showing posts from September, 2011

Form templates in Dynamics AX 2012

Image
A primary focus in Dynamics AX 2012 was to increase a developer's productivity by automating common tasks. As part of this initiative, a new feature was introduced in Dynamics AX 2012 in the AOT. This is the creation of new forms using form templates. If you right click on the form node, you can see an extra option there - New Form from template As seen in the image above, you have an option to create seven different form based on the pre-defined templates, these are ListPage DetailsFormMaster DetailsFormTransaction SimpleListDetails SimpleList TableOfContents Dialog DropDialog Let us look at these in more details. ListPage - A list page is a form that displays a list of data related to a particular entity or business object. A list page provides provisions for displaying data and taking actions on this data. Every module has at least a couple of list pages. List pages are further classified as primary and secondary list pages. A secondary list page will only displa...

Debug BP errors in Dynamics AX 2012

Image
With Dynamics AX 2012, some new BP errors have been introduced. Often, while fixing BP errors, I turn to the List of Best Practice Error and Warning Messages page on MSDN for help. But what if you are getting a BP error and there is no clear description on how to fix it. In such scenarios, I always debug the BP error and try to see what is causing this BP error in the first place. Let us do this with a simple example. On a Dynamics AX 2012 machine, Create a table with just two fields, ItemId and Name. Create a normal relation on the table with InventTable on ItemId == InventTable.ItemId On running the BP check on this table, among other BP errors, you will receive this new to Dynamics AX 2012 BP error - Only foreign key constraints are allowed on this table. Some of you may know the reason why this BP error is being thrown. For those who do not know the reason, please hold on to that doubt, I'll explain it shortly in the end. Let us get back to the original topic of th...

Regular expressions in Dynamics AX

Image
In all versions of Dynamics AX, the Find window supports regular expressions. Recently I discovered that even the label editor supports regular expressions. Using regular expressions in the find window and the label editor can significantly reduce your search times and you can narrow down your search to exactly what you are searching for. Let us look at some example. Suppose I want to search for all classes which have methods which are named like the following, enable(Any text here)Buttons. So all names like enableActivityButtons, enableDisableButtons, enableAllButtons etc should be found. So, we first need to analyze our expression requirement. Our search string should start with enable . For that, we need to enter <enable . The < character matches the specified string at the start of the string. Similiarly, for matching Buttons at the end of the string, we need to specify Button> . The > character matches the specified string before it at the end of the ...