Showing posts with label Event. Show all posts
Showing posts with label Event. Show all posts

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.