Posts

Showing posts from October, 2011

“Day in the Life Benchmark” available for download

Microsoft has recently released the Day in the Life Benchmark documents on PartnerSource. You can read more about it on the Dynamics Ax Performance Team Blog . The benchmark numbers shared there are really encouraging and truly shows that Dynamics AX 2012 is a robust and agile erp platform to base your business on. Note: PartnerSource or CustomerSource login is required.

Get selected records in Dynamics AX 2012

Image
In my earlier post, we discussed how we can retrieve all selected records on a list page. You can read that post here . Retrieving all selected records from a caller form is very easy. The code for this can be found in a number of places in standard Dynamics AX codebase. The general approach is to use the dataSource.getFirst(1) statement to get the first selected record and loop through the remaining using dataSource.getNext() . In Dynamics AX 2009, a new class was introduced for this purpose. This was the MultiSelectionHelper class. In Dynamics AX 2012, another new class has been introduced to retrieve the selected records. This is the MultiSelectionContext class. The MultiSelectionHelper class is an application class. It presents two constrcutors. The standard constructor method just creates a new instance of the MultiSelectionHelper class. When this construct is used, you will have to explicitly set the dataSource to be used for fethcing selected records. This can be done...

New security model in Dynamics AX 2012

Image
In Dynamics AX 2012, one of the key area that has gone a total overhaul is Security. In Dynamics AX 4.0 and Dynamics AX 2009, the security model was module based. Users were assigned to user groups which grouped permissions to the various objects. These permissions were controlled by security keys. The biggest drawback of this model was that you could not have the same security user group apply across multiple companies. You still had to create the same user group across different groups. With Dynamics AX 2012, all this has changed. The security model in Dynamics AX 2012 is role based. This means that you can relate the day to day business processes to roles. Users are assigned to roles. Roles contain a group of duties or privileges. It is logically very easy now to configure security in Dynamics AX 2012. The Security keys in the AOT are now obsolete in Dynamics AX 2012. It is present for backward compatibility. If you right click on the Security keys node, you dont have an option ...

How to get list page's datasource in Dynamics AX 2012?

Image
Recently, I had a requirement where I needed to disable a button on a list page if the records selected did not meet a particular condition. Let me explain you this with an example. Say I have a new button on the Projects list page. This button should be enabled only if all projects selected have the same project contract ID. If the contract ID is different for the selected projects, the button should be disabled. So how can we achieve this? On a form, this can be done in a very straight forward way. Just loop through all the selected records and check if the project contract IDs are different. If they are, just disable the button. But on a list page, the form datasource is not readily available. After some investigation, I found out a way of doing this. As you must be knowing, all list pages in Dynamics AX 2012 are controlled via interaction classes. This is the new framework model. If you are new to this and dont know about these, I'll recommend you learn more on this on the H...

QueryDataSourceStr - new intrinsic function in Dynamics AX 2012

There is a new intrinsic function introduced in Dynamics AX 2012. This is the QueryDataSourceStr() function. This function returns a string of the datasource name. The queryDataSourceStr() function checks if the supplied datasource name exists in the query in the AOT or not. An important point to note here is that all the intrinsic functions like formStr, classStr, queryStr and queryDataSourceStr invoke real time compiler check. This means that the compiler checks for the existence of the object in the AOT as soon as the function call is completed. In case the object name is not found, an error is shown immediately by displaying a red squiggly line.