≡ Menu




Form Development from scratch Dynamics Ax 2012 R3 part 2

Now we start development of form. First form we will build for Simple list form for Diagnostic table

For this open AOT and right click on Form Node and click on simple list form template

SimpleListSelection

 

Drag newly created form in Project and rename it “DiagonasisticTable”.

DiagonasisticTableForm

Expand DiagonsisticTable form and Right click on data source node to new Data source. Update name of name and Table name as DiagonsisticTable.

DiagnonsticDataSource

Now expand Designs=> Design Expand=> group Container and select grid

 

Grid

Right click on grid, click on properties window and set these properties

Data Source: DiagonasisticTable

DataGroup: overView

GridProperties

 

Save the form and right click on form open it. The form will look like similar

NewDiagonaistic Form

 

If you try to enter duplicate values in Diagnostic number field. Due to unique index on Diagnostic number it did not let you do it.

DiagonistiIndexWorking

 

 

 

 

New create a display menu with Name “MnuDiagonisticTable” and set it object Type to form and object Name as “DiagonisticTable”.  Save it.

diaganostic

 

Now expand Diagonaistictable right click on it and set its “FormRef” property with mnuDiagonisticsTable

DiaganosticViewMnu

This property provides us option of “View Details” on lookup field. We see its function in Master detail form.

 

Detail form:

 

Now we create a detail from for patient table. Create a new form and add data source and set its Name and DataSource value to Patienttable.

patientTableForm

Right click on PatientTable data source and set “InsertIfEmpty” to false

AdmissionSource

 

Now expand Designs and add new action tab, inside button group add three command buttons.

Rename them into “btnNew”, “btnEdit” and “btnDelete”. And from property window set their command to new, edit and delete.

NewButton

 

You can also select button Image by update following Properties

 

New Img property

Now expand Designs=>Design under ActionTab add a new Tab. Set Tab style property to fast tab.

Add new tab page in Tab and set is width and height value as follow

 

Tabs

 

 

Add new group control set its width and height like above one and column property to 2.

And set is data source to patientTable and Data group property to overview

PatientGroupProperties

Now form structure will look like

PatientDetailsStructure

Now open the form let’s see how it look like

PatientDetailsgroup

Test the form and click add remove entries

PatientFormWithData

 

Parent child form:

 

Now we expand patientTable form to Parent child form.

Now expand DataSource of node of PatientTable form and add a new data source. And set its table property to AdmissionTable, Name to AdmissionTable, and Set its JoinSource to PatientTable

 

AdmissionSource

 

 

PasteActionTabl

 

 

Now expand the form designer and add a new tab Page under patient tab and add new action pane There Set DataSource Property of ActionTab to AdmissionTable so all control inside this action tab works for AdmissionTable. In Button group add three command buttons and set their name “BtnNewAdmission”, “BtnEditAdmission” and “BtnDeleteAdmission”. After this set  there command property  to “New”,”Edit” and “Delete”.

AdmissionButton

Now add a grid in this tab and set its data Source to AdmissionTable.

AdmissionGrid

 

 

Drag and drop fields from AdmissionTable data Source to grid

AdmissionGridFields

 

Now open the form lets how it look like

Our parent Child from

You can see that here admission Date is greater than Discharge Date, for this we have to add some validation rules, which are not part of current post. We let it go.

AdmissionTableGridWorks

If you right click on diagnostic number field in grid, from pop up menu view detail option leads us Diagnostic table form.

ViewDetail link

 

This option comes due to we add menu Item in table properties in one of above step I am again adding its picture here

DiaganosticViewMnu

 

Now we create a new Display Menu Item “MenuPatientTable” and set its object property to

PatientMenu

 

Now we create a List page for Patient and attached Patient detail form with it.

 

For list page template we cannot attach table in data source for this we can create a Static Query Object. This Query Object will use as data Source in Form

 

First we have to create a Query. Re Name it to PatientQuery and form its DataSource add Patient table

PatientQuery

 

Expand PatientTable source in data table and right click on fields and set its field property to yes

QueryFieldDynamicsYes

 

After saving you will find all fields in Query

QueryFieldDetails

 

 

Now open AOT and right click on Form Node. From pop up menu select form template and then select list page.

ListPage

 

Now search form with similar CopyOfSysBPStyle_ListPage Name.  Drag it to your project and rename it to PatientListPage

PatientListPage

Now expand Patient List page and set data source and sets property to PatientQuery. This query we created in previous step

PatientListPageQueryDataSource

 

This will result in all tables in query in forms data source. By default these table have create and edit to no.

PatientListPageTablesList

Expand Designer  node of Form and select grid and set its dataSource property to Patient and drag and drop required fields from PatientTable_1 data Source to form.

 

Patient list Page grid

 

Now drag and drop required fields from data source to grid

PatientListPageGridFields

 

PatientListPageWorking

 

Now we are going to attached PatientDetail form with Patient

Now we add the Add, edit, delete and view functionality which leads the PatientDetail form

Expand the action tab in form and right click on menuItemButton  “newbutton”

PatientListPageAddNew

Set following properties

 

PatientAddNewButton

 

Expand next button group “MaintainedGroup” and and Open property window of EditButton

 

PatientlistPageEditButton

From Property window set following fields

DataSource = “PatientTable_1”

OpenMode =”Edit”

CopyCallerQuery=”Yes”

MenuItemName =”mnupatientTable”

PatientListPageEditButtonProperty

 

Now select mnuItemButton “ViewButton”

patientListPageViewButton

 

From Property window and set

DataSource = “PatientTable_1”

OpenMode =”View”

CopyCallerQuery=”Yes”

MenuItemName =”mnupatientTable”

 

PatientListPageViewButtonProperties

 

 

 

 

 

Now expand grid in form and set following property to MenuItemButton “ViewButton”, which we set in above step, so when we click on grid, detail form opens

patientListPageGridProperyToOpenListViewPage

 

 

Now run the form and lets try all functions.

 

Now create a new Display menu Item Say “MnuPatientListPage”. Set its form Property as follow

Menufor ListPage

 

Suppose That is hospital registration development is part of Accounts Payable module.

MnuList

Expand the menu Accounts Payable module expand common.

Add a new menu Item or drag drop existing menu item Common Set its following properties

Menufor ListPage

 

Now Open Ax client and open Account Payable area page

AccountsPayableAreaPage

 

PatientListPageINClient

 

{ 0 comments… add one }

Leave a Comment