Saturday 27 August 2016

development in ax7

In order to construct Simple List form in AX7, we will first create a table that will be populated from the form and use as data source of the form.
To create a new table, first add new item to the project.


After clicking new item, it will open the AX7 Artifacts. Select Data model from the left pane and table from the list of artifacts. Give appropriate name to your table. 

  

Table is created now new fields can be added either by dropping EDT's over field node or right click and create new fields. Add fields that are required on the form. These steps are mostly same as in earlier versions of AX. 

New index can also be created in same way. I have created 'Non duplicate' index in my table after adding table fields. 


Next is to create the form again by adding new item in the project. This time we need to select User interface from left pane and select form artifact from the list.


Give name to the form and select add. This will add new form to the project. Now the important thing is to apply pattern to the design. It can be done by right clicking the design node of the form and navigate to Apply pattern -> Simple List (As we are building Simple list form so i have selected this pattern, choose patterns you like to add on forms design). 


After applying the pattern, you can see it automatically gives you the pattern of design which needs to be completed in order to build form design. Make sure there is no missing control on the from design otherwise your project will not be build successfully. New controls can be added by right clicking on design node, hover to new and select appropriate control from the list. 


For Simple List form, we need to add following controls on it:
1. Action pane and Action pane Tab
After adding action pane and tab, we also need to add command buttons of ADD and DELETE same as we   do in earlier versions. 
2. Custom Filter Group
Custom Filter group needs to be added on this form to filter the form data. One issue i faced while adding custom group on design is that we also need to apply sub Patterns on it otherwise it wont work. Patterns can be applied in same  way as we did on design node.  

   

3. Finally we need  a grid control on the form to display, edit and insert data on the form. 
So after adding all controls we can see that pattern shows no missing control.


As form also need some data source, so we will drag and drop the table created earlier on form data source.


Now select the fields from the data source and drop them to the grid. 


This completes our table and form creation
In order to show above form in Fleet management area page, we need to create a display menu item of the form. Follow the same steps we did for form creation just need to select Display Menu Item artifact from list.


Finally add this menu item to Fleet management area page. This can be done by extending the Fleet management Menu. Right click the Fleet management Menu from fleet management model under User interface-> Menus and click on create extension. This will create extension of Fleet Management Menu. 
Now add the menu item within setup region of this menu.

This completes our implementation. In last you need to perform two steps:
1. Build your project in order to compile the new package.
2.  Synchronize project with database (this is important otherwise you will get sql errors on form).
Now Navigate to Fleet management -> Setup -> Vehicle Category

Here is the basic simple list form.

No comments:

Post a Comment