Friday, October 30, 2009
Alternative method to open a webpage from Ax
WinApi::shellExecute('www.blogger.com');
You can use this format to open/show a specific XML file from disk as well. Like this:
WinApi::shellExecute('yourfile.xml','',@'C:\XMLFolder');
This will fire up your XML editor/viewer (possibly MS Internet Explorer) and display the specified file.
As an alternative, you can use the infolog for this as well. Like this:
infoLog.urlLookup('www.blogger.com');
or
infoLog.urlLookup(@'C:\XMLFolder\yourfile.xml');
This alternative method does not require extended security measures, like required when you use the WinAPI functions.
Yes, it's compatible with Windows 7!
Friday, October 9, 2009
How to add leading zeros to a string
1
11
2
In such cases, it may be helpful to add leading zeros to your string.
And tadaah! Ax to the rescue, again there is a helpful built-in function available, strRFix.
How it works? You specify your value to convert, the desired lenghth of the string and the character to use as a "filler".
Example:
info(strRFix('1',4,'0'));
gives '0001'.
The above numeric values sorted with their alphanumeric counterparts look like this:
0001
0002
0011
Use the function like this:
strRFix(int2str(intvalue),4,'0');
(Replace the intvalue with your variable. )
Basically, you can use this function to right align a string, based on a fixed length.
And don't forget you can specify your own character to 'fix' the string. So dots are allowed, as well as a space.
This function is relatively new in Ax, and even goes without any documentation in the standard help files and on Microsoft's MSDN. Too bad, as unknown is unloved.
Edit:
As someone pointed out in the comments, not so new function at all. After lookin' into it, I found out it's even available in Ax V3 (maybe even earlier?). Lacking good documentation for sure!
Friday, October 2, 2009
Classic artwork - Nostalgic post
The post made me think about the old days and all the different versions of Axapta we've had a chance of working with in the past. And yes, it made me a bit nostalgic. I thought I share with you some of the artwork of old Axapta versions. Maybe you can remenisce as well, or just get an idea on where Ax comes from.
The Axapta program icon, as used in versions 1.0 and 1.5.
(Note: The demo data included at that time, we are speaking 1998-1999, was a whopping big 5Mb DAT file...)
The main menu from version 1.5 has, for todays standards, a very basic look-and-feel.
With version 2.5, you could say Axapta went into its "orange" phase.
The Axapta program icon in version 2.5
The splash screen from version 2.5:
The main menu, as used in version 2.5.
By that time, besides building it's own modules, functionality from third parties was already integrated in Axapta (see the Shop Floor modules in the print screen).
As you can see by the number of tabs in the main menu, less was more those days.
After the release of version V.25, Damgaard regrouped the functionality. (For example: customers and sales go together, like items and BOM.) This made the size of the main menu somewhat controllable in version 3.0.
Note: We never really went LIVE with version 1.0 or version 1.5. We used version 1.5 for demo purposes internally, used version 2.0 to test and to start up with. Pretty soon after that came version 2.1.