IoC containers for extensibility

Dynamics 365 for Operations (AX 7) tries to get rid of the ugly concept of “customizations”, when developers directly change somebody else’s code, which has a plenty of negative consequences. Most importantly, installing a new version isn’t easy, because it requires dealing with conflicts in code. There are several ways how to make a class …

Continue reading ‘IoC containers for extensibility’ »

Custom date and time format

I was extending a customization of Dynamics AX when I ran into the following piece of code. It formats the current date and time to something like 20150525_0042. str dateValue, dateFormat;   dateValue = date2str( systemDateGet(), 321, DateDay::Digits2, DateSeparator::None, DateMonth::Digits2, DateSeparator::None, DateYear::Digits4, DateFlags::FormatAll);   dateFormat = strFmt( "%1%2%3", dateValue, ‘_’, subStr( strRem(time2Str(timeNow(), TimeSeparator::Space, TimeFormat::Auto), ‘ …

Continue reading ‘Custom date and time format’ »

Objects ignored by Code Upgrade Tool

When testing my new rule for code upgrade tool, I found that certain objects are skipped and rules are not checked for them. That makes the tool significantly less useful, because you can’t be sure that it found everything. This blog post explains why it happens, but unfortunately doesn’t provide any reasonable workaround, except making …

Continue reading ‘Objects ignored by Code Upgrade Tool’ »

Instrumentation and tracing

Regardless of how hard we try to write flawless software, sooner or later something goes wrong and we must identify where exactly the problem lies (to be able to fix it). One option is using the debugger, but it’s not always possible – we can’t reproduce the problem, for example. Another way is inserting some …

Continue reading ‘Instrumentation and tracing’ »

Data contract serialization from X++

You can decorate classes in AX2012 with DataContractAttribute in much the same way as in .NET with System.Runtime.Serialization.DataContractAttribute. The same is true also for DataMemberAttribute. This is a simple data contract class in X++: [DataContractAttribute] class ItemContract { str name;   [DataMemberAttribute("Name")] public str parmName(str _name = name) { name = _name; return name; } …

Continue reading ‘Data contract serialization from X++’ »