Thursday, November 28, 2013

Book review: Microsoft Dynamics AX 2012 Reporting Cookbook

Kamalakannan Elangovan has written a comprehensive book about reporting with SSRS in AX 2012. 

The basics are explained in the appendix “Introduction to SSRS” and chapter 1 “Understanding and Creating Simple SSRS Reports”.

Chapter 2 guides you through how you can make more vivid reports, explaining about how you can use multiple data regions in a report and how you can add charts, images, filters, documents maps and drill up/down to a report. It also explains about reports templates, the use of expressions and aggregation in reports.

The programming model is examined in chapter 3 and 4, covering a lot ground about working with report controllers, modifying the report user dialog, adding business logic and not the least how to debug and write unit tests for the business logic. Chapter 4 is entirely dedicated to explain how to use the Report Data Provider as data source for reports.

Chapter 5 explains how to mix and use other data sources for your report, like XML feeds, external data sources and it shows you how to write OLAP reports and how to use the SQL Report Builder.

In chapter 6 the reports get more vivid with descriptions of matrix reports, chart reports, and how to put use gauges in a report.

In chapter 7 upgrading and analyzing reports from earlier versions, and you get recipies for moving different kinds of constructs from the legacy reporting to SSRS, including how to add inventory- and financial dimensions to a report. This is very useful.

Chapter 8 is the chapter for everything else. It holds sections about troubleshooting, print management, e-mail, and a few other others things that cannot fill an entire chapter.

I am very happy to see that this book is not all a about the happy path where everything just works. It means a lot to me to see troubleshooting, debugging, upgrade issues and unit testing be a part of the book.

This book is extremely useful for AX developers writing SSRS reports, whether they are beginners or more experienced developers. If you are just buying one book about reports with AX the year, this must be it. Otherwise, I suggest you buy the other released book too, “Developing SSRS Reports for Dynamics AX”. They complement each other very good. 

You can buy the book directly from Packt Publishing here:

And you can of course buy the book from Amazon, Barnes & Noble etc. too.

Tuesday, November 26, 2013

Thursday, November 14, 2013

Odd synchronization issues in AX 2012

I have an AX 2012 R2 developer box, where I several times have installed and uninstalled a couple of different models.

Until now I have not spent much time on synchronization issues, but today I needed to solve them all for the work ahead.

And it turned out that I had a lot of issues to deal with, like the dreaded error:
"Illegal data conversion from original field xxx.yyy to xxx.zzz: unable to convert data types to anything but character field type (0 to 4)"

The odd thing that nearly drove me crazy, was that I got errors on tables that no longer exist. The synchronization form simply showed tables names that are not in the AOT, not in the ModelStore database and not in the SQLDictionary table.

As it turns out synchronization issues accumulate in the SqlSyncInfo kernel table, until fixed by the synchronization engine and they are never reconsidered. If you have old errors that were not fixed, they remain in this table even if you delete the offending table from the AOT.

So deleting the records, in SqlSyncInfo, for these obsolete tables that I no longer have in my application, fixed my issue and I could get to work on the real synchronization issues.

Remember always to take great care when messing with these system tables. One backup too many is much better than one too little.  

Friday, November 8, 2013

Translate text with Microsoft Translator from AX

I recently had a task involving the translation of a few thousand labels. To speed up the translation I figured that I would get a head start if I could somehow automate parts of the process. I found bits and pieces with which I could use the Bing or Microsoft Translator API for the task, and here is how to implement these in AX.

First of all, you need to sign up for the service. You do that from the data market on Windows Azure. You can translate up to 2000000 characters a month for free. Here is a link to sign up for the service:

The bits and pieces I could find for calling the service is .NET code, so I have implemented this part as a C# Project.

Here's the code for that part: You need to add the Global class to the project, to get a proxy for it. It is used by the C# code.

With the C# Project in place, you can now do translation using this simple code:
// Sign up:
// Translator language codes:
static void EGTranslateSample(Args _args)
    EGBingTranslation.Translator    translator;
    System.String                   clientId        = "YourClientId";
    System.String                   clientSecret    = "XYZ123";
    str                             translatedTxt;

        translator = new EGBingTranslation.Translator();

        // Create an access token
        translator.CreateToken(clientId, clientSecret);

        // Translate
        translatedTxt = translator.Translate("HvedeĂžl smager godt", "da", "en");

    catch (Exception::CLRError)
    info (translatedTxt);

You get your Client Id and Client Secret when you sign up for the service on Azure.

Please note that the Microsoft translation cannot stand alone, unless you think you users are in need of some cheap laughs. You have to have a human to review the translations.

It seems that when you translate between two languages of which neither is English, that the translation is done using English as a "middleman". So for example a Danish to German translation is done first from Danish to English and then from English to German. In that process a lot of context can be lost and the result will not always be correct.

Sharing my AX RSS feeds

Murray Fife recently shared a list of all his AX RSS feeds. I thought I would do the same.

So here you can find an OPML file with all my current feeds:

Happy RSS'ing.