When to use Managed Code in Dynamics AX

 At a Dynamics AX conference in summer 2011, I was asked for guidance on when to use C# compiled to .NET Framework CIL, instead of traditional interpreted X++ compiled to p-code, in my Dynamics AX application. I will describe some deciding factors for you to consider. Some material presented herein is applies only to AX…

0

X++ Compiler Changes in Dynamics AX 2012

In Microsoft Dynamics AX 2012, we made compiler changes to make the X++ language more reliable and to prevent problems that may cause runtime errors.  1.  Super() cannot Call an Abstract Method Suppose an abstract method is implemented by a derived class.  If the method in the derived class tries to call super() to reach the…

3

New Option to Log X++ Max-Length String Truncation

In X++ you can optionally declare a string to have a specified maximum length:   str 5 maxLen5String;   Semantically, if you try to store more than 5 characters to this string, it will be truncated.   In March 2010 we blogged here about the X++ max-length string type, and asked how we should handle…

0

.NET Interop to X++ When X++ Runs as CIL

In Microsoft Dynamics AX 2012 we have interoperability features that enable your .NET Framework C# code to call methods on AX classes and tables. We call this feature .NET interop to X++. In AX 2012 we also added the ability to run X++ code as .NET CIL. Most X++ as CIL scenarios run as services…

1

Changes to the Collection Classes in Dynamics AX 2012

In Microsoft Dynamics AX 2012 we introduced the ability to compile X++ code into .NET Framework CIL. CIL can run faster than interpreted X++ for computationally intensive applications, and for applications which create large numbers of objects that must be garbage collected. The mechanisms for running X++ as CIL include: Services runAs function (or Global::runClassMethodAsIL)…

1

How to use X++ Delegates in Dynamics AX 2012

In this post I want to cover some of the core functional aspects of the new delegates feature introduced in AX 2012. X++ delegates expose the publisher -subscriber pattern where a delegate defines a clear contract in a publisher class. This contract is used when an event occurs where the event can be a change…


X++ script host.

I was looking at the API that we publish for the X++ compiler, and it struck me that it would be really easy to implement a script host for X++. This is a program that allows you to execute arbitrary X++ code that is stored in files in the file system. In this way, you…


Working with System.Char in X++

There are situations where it is useful to workl with characters in X++. As you know, X++ does not have the concept of characters in the defined in the language: Only strings are defined. However, it is not impossible to work with characters in X++, if you use the managed System.Char type. It will not win any…