Connection to external database

You sometimes need to connect from Dynamics AX to another database and read or write data there. The usual approach uses OdbcConnection class, as described on MSDN in How to: Connect to an External Database from X++ Code [AX 2012]. Although it definitely is a possible solution (I used it already in AX 3.0), it …

Continue reading ‘Connection to external database’ »

AX management shell – multiple models

Even if you’re not familiar with PowerShell, you probably don’t have much trouble with using AX management cmdlets. You just call the right command, set some parameters and it’s done. # Just for example Export-AXModel -Model "MyModel" -File "c:\my.axmodel" If you don’t know the parameters, you’ll simply use Get-Help or some of its aliases, such …

Continue reading ‘AX management shell – multiple models’ »

Refactoring of financial reasons

If you’re not sure what “refactoring” means, note that it is a change of the structure of code without changing how the application behaves. It might sound useless, but it’s actually very important. You must realize that the quality of code doesn’t depend only on its runtime behavior – whether you can easily maintain and …

Continue reading ‘Refactoring of financial reasons’ »

Customer Experience Improvement Program dialog

If you create a script that runs AX client, e.g. to compile CIL, you might find that it gets stuck immediately after starting AX. It’s typically because your build user is asked to join the Customer Experience Improvement Program. One option is to log as the build user and choose yes or no. But if …

Continue reading ‘Customer Experience Improvement Program dialog’ »

Test Data Transfer Tool: Getting errors from log

I imported data to AX with the Test Data Transfer Tool and it told me that some errors occured. The log file is quite large, so I asked myself what’s the easiest way to find these errors. This is my approach, using a very simple Powershell script: [xml]$dplog = Get-Content C:\Windows\System32\dplog.xml $dplog.root.item | ? Status …

Continue reading ‘Test Data Transfer Tool: Getting errors from log’ »