The power of well-designed code

My previous blog post reminded me a refactoring that I did on one of my previous projects (in AX 2012). I needed to adjust a piece of logic and found that it’s implemented as a method with more than two thousand lines. Of course, nobody could understand what’s going on there. Such code in unmaintainable. …

Continue reading ‘The power of well-designed code’ »

Compare records in code

When saving a record, I had to check which fields had changed and react in a special way if only certain fields (and not any other) changed their value. I could iterate all fields and compare their values in two table buffers (the original and the updated one), but I thought that D365FO might already …

Continue reading ‘Compare records in code’ »

First chance exceptions

Dynamics 365 for Finance and Operations runs completely in “.NET”, which has some interesting implications. The runtime and tools working with it (such as Visual Studio) offer many new options that may be very useful. One of these options is the ability to catch first chance exceptions. When an exception is thrown, it’s considered a …

Continue reading ‘First chance exceptions’ »

Label ID fix

I recently saw an interesting problem with labels in AX 2012 – two customizations created different labels with the same IDs, therefore the newer won and the older one showed completely wrong texts in GUI. For example, one customization created a form with caption @XYZ1 = “Customers”. Another customization created a label with the same …

Continue reading ‘Label ID fix’ »

X++ to CIL: Object must implement IConvertible

Somebody asked in Dynamics User Group forum about an error thrown by RetailCommonWebAPI running in a batch in AX 2012 (RetailCommonWebAPI in batch mode). I don’t want to discuss that particular problem here, but I want to show the underlying cause, because it’s actually quite tricky. What I’m discussing below is related to CIL generated …

Continue reading ‘X++ to CIL: Object must implement IConvertible’ »