Sunday, February 14, 2016

Extension capabilities of AX 7 (in CTP 8) – Forms

In my last post, I had discussed about extension capabilities of Table. In this post  will cover extension capabilities of forms.

There are many form extension examples available in AX7.

I will take example of SalesTable.Extension.


Searching for element in AX 7 has become very user friendly. I loved the way it works.




To demonstrate all the capabilities I have created a new extension of SalesTable : SalesTable.FDDXXXExtension
By default when you create an extension, its name will be <ParentObject.extension>. You can rename it as you want.
You can do the following in the AX 7 form extensions:

Add new datasource:

I have added new datasource VINExampleTable to SalesTable.FDDXXXExtension.



As you see in the above screenshot, you can see the each new datasource added to the extension in Application Explorer.

Add new controls:

I have added a new string edit control: VINExampleString on overview grid




Change the properties of control:

Only few properties can be changed, they are as follows:

Visible -> Yes/No
Enable -> Yes/No
Lable -> String
Help text -> String


You can copy the pre/post event handlers for Form methods, Event nodes and datasource event nodes. You can not create event handler on form datasource methods.


You can create event handler node on the event nodes of the datasource fields
You cannot create event handler on methods of the datasoure fields.



You can create event handler node on the event nodes of the controls
You cannot create event handler on methods of the controls.






Saturday, February 13, 2016

Extension capabilities of AX 7 (in CTP 8) – Tables

In my last post, I had discussed the Extension capabilities of Base enum. In this post I will cover the extension capabilities of tables in AX 7.

There are many table extension examples available in AX7.

Example of table extension is CompanyImage.Extension

As shown in the above screenshot, For every change of property or node a new XML tag will be created in the underlying XML file.

To demonstrate all the capabilities I have created a new extension of SalesTable : SalesTable.FDDXXXExtension
By default when you create an extension, its name will be <ParentObject.extension>. You can rename it as you want.



When you compile(build) the object you get the compile error as follows:


To solve this you need to create an file CompileError.xml as follows:





You can read more here for the details of the file.

You can do the following in the AX 7 table extensions:


Create new fields

I have created a new string field: VINStringExample.




Create new field groups:

I have created a new group: VINExampleGroup and added my field VINStringExample in it.




Create new index:

I have created a new index: VINExampleIdx. There is a new property available on the index : “Index type”. It can be traditional (row) index and it can column index.




Create new relation:

I have created a new relation: VINExampleRelation. Delete actions are now available on relation itself as shown below.




Create (Pre/Post) Event handler of methods:

I have created a pre even handler for insert method of SalesTable. You need to copy the event handler method. Create new class and paste the event handler code as shown below.



If you go to SalesTable and click on find Event handler you will get the result showing all the event handles created for that method (as below)

Create/Copy event handler method of Event node:

In AX7 we have new node called Event node. There are 40 events available on table.
Similar to pre/post event handler on methods, you have to copy the event handler. Create new class and paste the event handler code as shown below:

P.S. If you create extension for inherited table, Table doesn't sync unless you add the parent table in project.

Saturday, February 6, 2016

Extension capabilities of AX 7 (in CTP 8) – Base enums

In this post I will describing the extension capabilities of AX7.

In AX 7, following elements can be extended:

  • Base Enum
  • Table
  • Form
  • Menu
  • Data Entity
  • Security Duty
  • Security Role
  • Classes
  • Map (Not yet possible in CTP8)
  • View (Not yet possible in CTP8)
I will cover extensibility of each element.

Base enum:

Example of base enum extension is DMFModule.Extension in out of box AX 7.


Not every base enum can be extended. There is a property called IsExtensible  on Base Enum.



Only Enums with this property true can be extended.
In extended base enum you can create new elements.


 Above screen shot shows the corresponding XML file created. You can set the values of following properties:
  • Name
  • Lable
  • Configuration keys
  • Country region codes

You cannot edit the value of element. Though you can change the values in XML but it is not recommended. In next post I will cover Table extensions.



Sunday, January 31, 2016

List of AX 7 courses available at partner source (as of 31 Jan 2016)


List of AX 7 courses available at partner source as of 31 Jan 2016:




















Microsoft Dynamics AX 7 terms - Element, Project, Model, Package, Solution and their relations

In this post I am going to cover basic terms of Dynamics AX 7 development.


Element: Element is the object in the AOT(Application Object Tree) such as tables, classes, forms etc.


Project: Project is a small, manageable group of elements. If you want to customize the element, it needs to be added to the project. Project always belongs to only 1 model. We can use project files to import/export between different instances of AX. It is saved as .AXPP file.   


Model: Model is defined as collection of elements that represent a distributable software solution. This included all the elements and the Metadata. Model belongs to only 1 package. You can modify elements belonging to same package where the model belongs. Model is a unit of development/customization.


Package: Package is a deployable container. It contains source files (XML files), resources and DLLs. It is similar to Model store of AX 2012. You can select one or more packages and create a deployable package, which can be used to move the code from one environment to other. Packages are stored under c:\packages folder. For every model new sub folder will be created under package folder. Package is unit of deployment.


Solution: Solution is a virtual grouping of projects in Visual Studio. In Visual Studio you can add project from same or different models from one or more packages.

Following is the diagram showing this structure.
  • Element is a part of project.
  • One element belongs to only one model and can be customized only in that model once.
  • Project is a part of model.
  • Model Can have many projects.
  • Package contains one or more models.
  • one model belongs to only 1 package.
  • Solution is Visual studio solution which can contain models from different packages.
  • Solution is Virtual grouping created for ease of managing the development objects.  
Following is the screenshot from the Visual studio:


Above solution has multiple models from different packages.
Models are of both customization models as well as extension models.



Above screen shows each model and corresponding packages.





Monday, January 25, 2016

Creating and deleting the model from Microsoft Dynamics AX 7


In my last post, We got our AX 7 VM. In this post I am going to explain how to create a model.
To create a model, We have to navigate to 'Dynamics AX 7' menu -> Model Management -> Create Model..


This will open up a wizard for creation of model.
Now In AX 7, there are 2 approaches for the development.

  • Extension approach -> This is the recommended approach. It creates separate assemblies for the elements of the model. Advantage is that it requires virtually no upgrade efforts when new product versions are released. But it has some limitations, We will discuss those in later posts 
  • Customization approach -> This is similar to over-layer approach which is followed in AX 2012 or earlier versions. It will update the same assemblies in the same package. When it comes to upgrade, this requires quite a lot of efforts 

Model creation for extension approach

When you are creating a mode, you need to decide which approach you are going to take. Let see how to create extension model first.
When the wizard is opened, you have to provide Model Name, publisher, Layer, Version, Description and ModelDisplayName(This will be shown everywhere in the visual studio).



I Prefer to keep the name as <Model>Extension. Here I am creating extension model for Application Suite.
Click Next.

Select whether to create model as an existing package or create new package. For Extension approach, you will have to select create new package. Click next.

Select the referenced packages. It is important to reference appropriate models. You can create extensions of the elements which belongs to these selected packages.
There are 2 approaches for models here.
  • You can create extension model per original model. For example ApplicationSuiteExtension model for ApplicationSuite and LedgerExtension for Ledger Model
  • You can create one extension model for all the extension objects. For example VINExtension model for both ApplicationSuite and Ledger model. In this case you reference to all models from which you need elements.
I personally prefer creating extension model per original model. Here I am selecting Application Suite model as reference model. (I could not select Application Platform in this form, there is option to update model later. In that option you can change the referenced models)

Review the summary screen and click on Finish. If the Create new project checkbox is checked, New screen for creating new project will be launched.

Give name to project same as model (recommended). Either create a new solution or you can add project to existing solution.

This will create new project. Now you can add elements to project and start customization.

Model creation for Customization approach:

When the wizard is opened, you have to provide Model Name, publisher, Layer, Version, Description and ModelDisplayName(This will be shown everywhere in the visual studio).


I Prefer to keep the name as <Model>Custom. Here I am creating customization/overlayer model for Application Suite.
Click Next.



Select whether to create model as an existing package or create new package. For customization approach, you will have to choose select existing package. Click next.


On this step you will see the difference. When you create new package, you get option to select the reference models, but when you add to existing package, you do not get to select the reference packages. As you see in the above screenshot, there are few reference packages already selected. I guess these are same as the original model which created this package. Finish the review and click on finish



Give name to project same as model (recommended). You have to create new solution here which is different from our first project where we had option to use the existing solution.

This will create new project. Now you can add elements to project and start customization.

In AX7 there is no database for the model. Model and elements are stored in XML format in the file system. These new models will be created under C:\Packages
For extension model, New folder is created under Packages folder. But for Customization model, new folder is created under the existing package.

Description of each model is stored under the Descriptor folder.


It is good to know these details, but refrain from making any changes to these files directly. You should always edit from Visual studio.

Deleting model:

I could not find any way to delete the model from Visual studio but you can directly go into the explorer and delete following things:
  • Solution created for the project(model)
  • For Extension model, Package folder created for that extension model.
  • For Customization model, folder created for the model under existing package and the descriptor xml file for the model.
Beware that I could not find any documentation anywhere but found it via experience. This may not be correct way and it may create unexplored problems

P.S.: When you look the model structure under Application suite, it is different from the rest of the models. This needs to be further studied more. This is tried on AX 7 CTP 8 version.