Monday, November 14, 2011

November AX news and tips

It's been extremely busy at work, and we've had the flu going around the office. It's been a bit quiet for a few weeks on this blog, but I'm alive and kicking again. I have some very interesting posts coming up, including (yes, finally) the 10-minute Windows Phone 7 app.
So get my RSS feed linked up and expect more great content. Remember all 2012 related articles are listed on the AX 2012 Developer Resources page. If you have anything you'd like to see a code walkthrough for, don't hesitate to contact me by email or on Twitter.

Meanwhile, I'll post a few AX news and tips I've picked up in the last few weeks. There's been the AXUG summit in Las Vegas, the European Tech Conference is going on right now in Nice, France, so lots of information to share, lots of announcements.


Microsoft Dynamics InformationSource (Beta)
Microsoft opened their new site called InformationSource, a portal for Dynamics Customers and Partners. Using your PartnerSource or CustomerSource logon (click "Sign In" at the top right of the page), you can access this beta site. The most notable things to me are under the "Services" section.
  • Application Analysis Tool (Beta): A tool designed to assist AX developers analyze and understand the X++ code and data model
  • Intelligent Data Management Framework (Beta): A tool designed to help system administrators optimize the ax database size and performance by purging and/or archiving data
  • Security Upgrade Advisor Tool (Beta): A tool intended to help simplify the process of upgrading security settings from earlier versions of AX to AX 2012
  • Code Upgrade Advisor Tool (Beta): A service to help developer upgrade their X++ code to AX 2012
I don't have a lot of details yet on these, but I downloaded them today so expected more on this later!
Besides the services, they have a library with videos, powerpoints and other documentation on 2012. Go check it out if you have a PartnerSource/CustomerSource login.


AX Session Language
A few weeks ago someone in our office needed to get the language id for the current session... (for reporting label purposes) Answer:
new Session().interfaceLanguage()


Form Datasource in AX 2012
Form datasources in AX 2012 now have an easier way of getting their QueryBuildDatasource... so when you are in the init() method of a form datasource, setting up a query, you can get the objects using
this.QueryBuildDatasource()
//and
this.queryRunQueryBuildDatasource()
Since "this" is the datasource anyway, it makes sense you should be able to access the datasource objects right from it. Courtesy of Vanya Kashperuk.


Parsing a string to a real / .NET objects by reference
Parsing a string to a real value has always been an issue in AX. str2Num() just doesn't cut it. So we decide to use System.Decimal from .NET. Unfortunately, the Parse() function throws an error if the conversion fails, even if you catch it. The other option is TryParse(), but that requires you to pass a decimal by reference, which you can't do in X++! OR wait, YES you can in fact pass it (this work sin 2009 and 2012 both):
System.Decimal decimal = new System.Decimal(0);
System.Decimal::TryParse(stringValue, byref decimal);
YAY!


Debugging while using restricted roles
This other post on Kashperuk's blog is intended to show how to debug code while using a restricted role (non-sysadmin). However, I can see other interesting uses for this for testing security. Basically, there's a static method sysAdminMode() on the SecurityUtil class which takes a true or false to enable or disable it. Haven't played with it myself yet, but it sounds interesting for all sorts of things. Check out Vanya Kashperuk's blog.
SecurityUtil::SysAdminMode(false);


X++ Compiler Changes in AX 2012
The AX 2012 Developer Resources page has had a link to MSDN for quite a while, but the Issues Concerning X++ blog summed it all up in a blog post.


AX Roadmap
On the AXUG Summit 2011 in Las Vegas, Microsoft made some announcements regarding the roadmap of AX. Dynamics World has made a good summary which you can find right here. Bottom line is CU2 will be released before the end of the year, Feature Pack 1 (which includes the retail vertical) will be January 2012, and first quarter of 2013 will see the release of AX 2012 R2, which will include support for SQL 2012 including the exciting new BI capabilities.

2 comments:

  1. In ax 2009 byref does not work on the server side (at least did not earlier, have not tested lately)

    ReplyDelete
  2. We did this byref in AX 2012, and I *think* it was server side but not entirely sure. I will have to test that.

    ReplyDelete