On March 31 and April 1, I will be attending Microsoft TechDays 2010 conference in Antwerp, Belgium. Me and my colleagues will be wearing a T-shirt that says RealDolmen (no doubt followed by a catchy slogan the PR people will come up with).
With over 80 sessions from international speakers to choose from, it will be difficult to pick the most interesting ones.
See you at TechDays.
Link: Microsoft TechDays 2010
Here’s a little ‘be-aware’ I’d like to share.
The function str2int() that converts a string to an integer will return ‘0′ if the input string is not an integer, so it is necessary to check if the string is an integer before casting it.
The function that does this is not IsNumeric() like in SQL or VB, but IsInteger().
Alternatively, you can also use str2IntOk(). Both are found in the global class.
I’ve seen people searching for this method (including me), so I just thought I’d share.
Here’s some sample code:
This week, we were shrinking a database of a development environment by deleting some companies.
Here a nice little SQL statement that uses the sp_MSforeachtable stored procedure to delete all records of a specific company (CEU in this case) from all tables.
Certainly fast(er than AX) and gets the job done.
Use at your own risk
Are you one of those people who always minimize the content pane in AX 2009?
Are you one of those people who don’t know what the breadcrumb on top of the AX screen is for?
Do you already execute a job to disable the content pane on startup?
Then you might feel totally nostalgic when you see the Axapta 3 menu appearing after you run the following job in AX 2009.
A new book written by Mindaugas Pocius about AX development was published last month: Microsoft Dynamics AX 2009 Development Cookbook.
The book contains step-by-step instructions along with screenshots and aims at Dynamics AX developers of beginner and intermediate level.
To give you an idea, here are the chapters:
Chapter 1: Processing Data
Chapter 2: Working with Forms
Chapter 3: Working with Data in Forms
Chapter 4: Building Lookups
Chapter 5: Processing Business Tasks
Chapter 6: Integration with Microsoft Ofice
You can buy the book, eg on Amazon.com or at Packt Publishing.
You can also download the sample code used in the book.
I had this situation where overriding the lookup() method on a field on a form was not working.
The problem was the AutoDatagroup property on the field group on my grid.
When this property is set to Yes, the lookup override will not work.

Also, when you change this property from ‘No’ to ‘Yes’ when methods have been added or overridden on the fields, the methods wil be cleared and you will loose your code.
Update: see comment by Luegisdorf about overwriting this method in datasource in stead of the control.
Someone on the Microsoft AX newsgroups asked how to get a list of directories and subdirectories given a folder. Here a job that does that:
If you want a quick way to check to what database and application folder you are connected, you can use the ‘Upgrade checklist’ form:
Administration – Setup – System – Checklists – Upgrade checklist.
It shows you:
- Database server
- Database name
- Application folder
- Layers in the application
There are a few tools I use daily that I really couldn’t live without. One of them is Launchy, by Josh Karlin (launchy.net).
From the website:
Launchy is a free windows and linux utility designed to help you forget about your start menu, the icons on your desktop, and even your file manager.
And it really does just that. You won’t be using the Start menu anymore once you’ve installed this tool.
You can download it here.
Once you’ve installed it, you will see… nothing, untill you hold Alt and tap Space.
Then you see something like this:

Once you start typing, say “Dynami…”, Launchy searches for programs that match the string you are typing. Tap Enter to launch the program.

You can use Launchy to launch specific AX configurations by creating a folder that contains axc files.
Go to the AX Client Configuration Tool, create your configurations and export them using Manage – Safe configuration file to store them in a folder.

You can setup Launchy to monitor this folder by holding Alt, tapping Space, right clicking on the Launchy window and clicking Options. On the tab Catalog, you should see something like the screenshot below. As you can see, I have already added the folder and the extension axc to the list.
Now you only need to click the Rescan Catalog button, and you’re set to go.
The end result should be something like this:

You should be able to launch right into any AX application with minimal effort now.
And of course, you can use Launchy to launch any other program as well.
Links:
Launchy website: launchy.net
Inspiration for this post: SmartStart 3000 Central
There is a new AX blog in the blogosphere by Patrick Kränzlin, nicknamed Luegisdorf. Patrick is very active on the Dynamics AX newsgroups, and is also the author of SmartStart 3000 Central, a tool for managing and launching Dynamics AX configurations and applications.
Be sure to check out his website, and his first post about reflection:
How to ignore Private, Protected and Abstract modifiers.
Hi guys,
It seems like I’m going to be doing a lot of AIF in the future, so I’d like to share the first AIF error I came across:
The path C:\AIF does not exist or is not accessible from an AOS server. Always use a UNC path.
You can get this error when setting up channels.
While I immediately know what the problem was (you have to use shares), my less technical-minded colleague didn’t know what to do.
This is what Wikipedia has to say about ‘UNC path’:
The Microsoft Windows UNC, short for Universal Naming Convention or Uniform Naming Convention, specifies a common syntax to describe the location of a network resource, such as a shared file, directory, or printer. The UNC syntax for Windows systems has the generic form:
\\ComputerName\SharedFolder\Resource
So there you have it, you have to use a shared folder in stead of a local folder.
This is logical, as AIF runs on server, and the AOS can not access your local folders.
There is an option on the ’status bar’ tab of the options screen (AX button – Extra – Options), that some people think that doesn’t work: Show AOS name.
You can see what I mean on the screenshot below.
Also note that this doesn’t really show the AOS you are connected to, it merely shows the value you specified in the instance name field in your configuration.
So does this functionality work? Yes, but not as you’d expect.
I’ve noticed some people are visiting this blog looking for code that runs multiple jobs, so here’s a job that does just that.
Easy enough
.
This method will append all text from the original file to the destination file.
While this is a very easy task, the method shows many of the things you come across when you are working with files in AX, like:
- Using the #File macro
- Asserting FileIOPermission to be able to access files
- Asserting InteropPermission to be able to use .NET Interop
- Using a set to assert multiple permissions at once
- Using .NET Clr Interop in AX (better than winapi and winapiserver)
- Optional cleaning up after you’re done using reverAssert()
Because all permissions are taken care of, this code will run client side as well as server side.
A (little) trick in between. I thought everyone was using this method, but I apparently I was wrong, so here you go.
Doing a full compile takes a long time, and because of that, it’s handy to be able to check how much of the process is done and how much remains.
Luckily, when doing a full compile, the Compiler Output form appears at the bottom of the screen where you can see what is currently being compiled.
The only problem is that most of the time, the AX client hangs and is not responsive during the compilation process, so you can’t see that information.
The solution to this is to press Crtl + Break.
You will see a window that says:
Are you sure that you want to cancel this operation?
To start the Debugger for Microsoft Dynamics, press and hold SHIFT while you click No.
While this screen is active, the Compiler Output form will update so you can check up on the status. When you’re done, be sure to click “No” to resume the full compile. Don’t click “Yes” because then the compilation will not resume and you’ll have to start again.