Friday, July 23, 2010

SysQueryRangeUtil class - use method name as query criteria

This is a cool new feature in AX 2009 - you can now use a method name instead of literal value in query criteria!

For example, if you run a report every month, previously you need to change the date criteria in each month you running the report (ie. “01/06/2010..30/06/2010”,  “01/07/2010..31/07/2010”, etc).
Now you only need to enter (monthRange(0, 0)) which will automatic return the correct first day and last day of the month.

Refer to the SysQueryRangeUtil class – there are other useful methods such as dateRange(), currentEmployeeId(), etc. It’s also possible to create new method on this class for special purpose!

Thursday, July 22, 2010

Installing Dynamics AX 2009 Client on Windows 7

When I try to install Dynamics AX 2009 Client on Windows 7, the installation failed with the following error:-
RegAsm : error RA0000 : Could not load file or assembly 'System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
...
Install: During Setup of an error occurred. Program run: C:\Windows\Microsoft.NET\Framework\v4.0.30319\regasm.exe. Parameters: C:\Program Files\Microsoft Dynamics AX\Common\MindKeyGroup.MindKey.Wheel.dll /unregister
This looks strange to me because Windows 7 is certified for running AX 2009 Client. After looking into details of the error, it seems that .NET Framework v4.0 is used during the installation.
I uninstalled the Microsoft .NET Framework 4 Client Profile and install again the AX 2009 Client. The installation then was successfully.

Tuesday, July 6, 2010

Dynamics AX 2009 Rollup 5 has been released!

Dynamics AX 2009 Rollup 5 is available for download now. Refer to the post from Dynamics AX Sustained Engineering team here:-
http://blogs.technet.com/b/dynamicsaxse/archive/2010/06/30/dynamics-ax-2009-rollup-5-has-been-released-to-partner-source-and-customer-source.aspx

Update: Direct links to download the Rollup 5 as below:
AX 2009 Rollup 5 KB982811 (Build # 5.0.593.1287)
AX 2009 SP1 Rollup 5 KB982812 (Build # 5.0.1500.2985)

strFmtLB and the newline character (\n) in label files

You want to split your info message into multiple lines, so you use the \n newline character.
You write the following code:-
info("Line1\nLine2");
You tested it's working and the output message is split into 2 lines as below:-
Line1
Line2

Now you've converted the string into a label, so you update your code such as the one below:-
info("@WKN1");
But when you re-run the code, you realised that the newline character is no longer working and printed directly on screen. The message is displayed as one line instead of two as below:-
Line1\nLine2

To display the message correctly, you need to use the global method strFmtLB:-
info(strFmtLB("@WKN1"));
If your string message contains placeholders (%1, %2, etc.), then you can use both strFmtLB and strFmt methods together:-
info(strFmtLB(strFmt("@SYS39890", "Line1", "Line2")));
Result of running the above code:-
Line1
 Line2