Tuesday, January 26, 2016

AX 7 developer's tools add-ins

With coming Visual Studio IDE in AX 7 developers got a few useful and nor useful add-ins, that they will use anyway to make development more easy. Let's understand when and how to use.

Purpose of the article: understand how to use VS developer's add-ins in AX 7.

There are 9 add-ins that are available right now in Dynamics 'AX 7' menu Addins. Let's talk about a few of them.

1. Data Entity report. Allows you to get the list of all Data Entities (a new element in AX 7 AOT).



2.  Data Entity statistics. Just total count of data entities and property IsPublic.



3. Run form patterns report. Very useful report when you want to create a new form that will based on a specific pattern.


4. Form statistics. Shows a total count of forms and count for each pattern.


5. Import task recording. You can write a task recording from AX 7 and import it to Visual Studio to build unit test classes. Next time I will write an article about Task Recorder and how to use it in AX 7 and Visual Studio.



You create your own more useful add-ins for Visual Studio by creating Dynamics Developer Tools Add-in project.

Thursday, January 14, 2016

How to create a new model in AX 7 depends on AX 7 architecture - packages, models, layers

This article will make more clarify my previous post about extensions and customizations in AX 7.

Purpose of the article: 
1. Understand how to create a new module in AX 7;
2. Understand how packages and layers cooperates with modules in AX 7.


Make your choose 
We have 2 ways to create a new module

1. Create new package (create a new module in a new package);
2. Select existing package (create a new module in a existing package).

Let's take in basic Tax package that includes module Tax in SYS layer. 
As in AX 2012 a module can exists only in one layer.


Create a new module in a new package
Purpose: extends standard Tax functionality by adding a few new reports.


1. Name your model and choose a layer where a module is going to be created


2. Choose "Create new package"


3. Choose packages, which elements you want to use. For our purpose it's "ApplicationPlatform", "Tax" and "TaxFormAdaptor". Don't check any packages that you do not need. In the future, you will have an opportunity to compile whole single package and also whole package with his related packages. So, it will take a long time to make compilation in second case.


4. Check your selected data one more time 


5. Let's check that package and module were created properly. 

Our created project will be linked to a new module in a layer VAR


Also check that folders for package and module were created


In AOT we can find out that new module existed in a new package


Finally we can create a few new reports and deploy whole package to production environment without compilation any other packages. Pretty simple and can be done without any pause in production work, without any risk. In the future we can create a new module in this package and extend this package.



Consuming packages


Packages consumed by



Create a new module in an existing package
Purpose: extends standard Tax functionality by adding a few new reports and make modifications in a standard reports.

Comments to purpose: making modifications in a standard reports (functionality) is a wrong way. Better way is copying of a standard report to our new module and modifying it.

1. Name your model and choose a layer where a module is going to be created


2. Choose "Select existing package" and select Tax package


3. We are not allowed to choose referenced package, because existed package already has referenced packages. You can change referenced packages for existed package late in "Update model parameter" form.

4. Check your selected data one more time 


5. Let's check that module was created properly. 

Our created project will be linked to a new module in a layer VAR


Also check that folder for module was created






In AOT we can find out that new module existed in chosen Tax package. Now we have 2 modules in 1 package - "Tax" in SYS layer (existed previously) and "Tax Reporting (Existing Package)"in VAR layer.


Finally we can create a few new reports in our module and customize existed reports from Tax package. When we will deploy or package to production environment we will destroy the work of Tax functionality during whole deploying process. In the future if MS will make modifications in standard reports that we changed - we will lose our changes while MS update will be finished. 



Consuming packages


Packages consumed by



Let's do the best way development. Thank you for your time.

Sunday, January 10, 2016

Dynamics AX 7 Development - Extensions VS Customization

What is the difference between Extensions and Customization and which of them you should choose for your solution?

Model is a unit of development or customization. Extensions get isolated in their assemblies.




AX 7 introduces a new way of customizing an application by using extensions.



Using of extensions allows you to create new model elements and to extend existing model elements.
Using customization you need to create event handlers and new plug-ins.

Advantages of extensions
  1. You need to manage only your extension artifacts. 
  2. You can service your solutions independently without concerns about other customizations.

Learn more about extensions and customizations in my new post.

Dynamics AX 7 Development - Packages, Models, Projects

Packages, Models, Projects in AX 7. Let's figure out what is it.

Package in AX 7 is independent deployable unit of one or more model.
Model is a group of elements (metadata and source files) that typically constitute a distributable software solution.
Project - simple Visual Studio project that stores AOT elements. The project helps you group the elements.


A simple way to understand is described on image below.


Package are folders located in the model store folder of the AX 7 application. The default model store folder is “c:\packages”.




Model folders are contained in their package folder. A model folder contains type-specific folders.



Every dependency of packages are described in descriptor files and can be shown in AX 7 viewer.



In model view, AE is organized by models. The package that a model belongs to is shown in parenthesis next to the model name.



The main purpose of VS project is to store AOT elements. AX 7 has not Shared or Private projects. Each user has their own projects that each of them related only to one model. Use multiple projects in Visual Studio solution to work with elements from different models.



So, that's way, how Packages, Models and Projects interact with each other.

Learn more about packages, models and layers in my new post.

Dynamics AX 7 Development - What’s new in X++

In this article I describe main changes in X++ language for AX 7. Almost changes were appear because of IDE Visual Studio.

No more p-code
1. In AX 7 the new X++ compiler generates CIL only
2. Compiled X++ code now runs exclusively as .NET CIL
3. CIL runs much faster


Enhancements to X++
1. try … catch … finally 












2. Initialize class’s field in the field’s declaration statement. 









3. Declare variables in smaller scopes, not just at the start of methods.
4. var keyword is available as a shortcut that allows the compiler to infer the type of the declared variable.
5. A class’s fields can be static. 
6. An attribute decoration can omit suffix of attribute name if suffix is "Attribute". 


Backward-incompatible changes to X++
1. No longer part of the X++ language (compile error) - changeSite, pause, window 
2. The keywords client and server will be ignored, because all compiled X++ code is executed as .NET CIL on the server.
3. CIL helper methods have been removed. 
4. 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 AX7 project.
5. 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.