In this article we describe the main changes in the X++ language for AX 7. Almost all changes will appear because of the Visual Studio’s IDE.
No more p-code
- In AX 7 the new X++ compiler generates CIL only.
- Compiled X++ code now runs exclusively as .NET CIL.
- CIL runs much faster.
Enhancements to X++
- try … catch … finally:
- Initialize stuff in the class declaration statement.
- Declare variables in smaller scopes, not just at the start of methods.
- VAR keyword is available as a shortcut that allows the compiler to infer the type of the declared variable.
- An attribute declaration can omit suffix of attribute name if suffix is “Attribute”.
Backward-incompatible changes to X++
- No longer part of the X++ language (compile error) – changeSite, pause, window
- The keywords client and server will be ignored, because all compiled X++ code is executed as .NET CIL on the server.
- CIL helper methods have been removed.
- AX 7 eliminates the concept of AOT > Jobs. Instead use static main method of a class and then set the class as the startup object from the AX 7 project.
- Use const type instead macros.
AX7 LINQ Provider for use in C#
Language Integrated Query (LINQ) is a set of classes and methods that enable you to access data that is stored in a variety of places and formats.
When very few records are fetched C# LINQ is three times longer than while select.
Original article in AX7DEV Blog.