Sie sind auf Seite 1von 12

Microsoft Dynamics AX 2012 R3

Development Overview
LABS

Microsoft Dynamics Ax 2012 R3 Development Overview Page 1 of


12
Table of Contents
LAB Scenario ................................................................................................................................... 3
Details ......................................................................................................................................... 3
LAB - Data Dictionary ...................................................................................................................... 4
Creating EDTs .............................................................................................................................. 5
Creating BaseEnums ................................................................................................................... 5
Creating Tables ........................................................................................................................... 6
Creating an Index ........................................................................................................................ 7
Creating a Relation ...................................................................................................................... 7
Creating Delete Action ................................................................................................................ 8
LAB – AOT Query & View ................................................................................................................ 9
Creating AOT Query .................................................................................................................... 9
Creating AOT View .................................................................................................................... 10

Microsoft Dynamics Ax 2012 R3 Development Overview Page 2 of


12
LAB Scenario

Details
 Need to develop a Student information form in which student’s course information can
be maintained.
 Required another user interface where Course information can be maintained.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 3 of


12
LAB - Data Dictionary

 Need to create below mentioned tables in Dynamics AX

StudentInformation
StudentId String
Name String
Father Name String
Gender Enum (Male\Female)
DOB Date
Address String
NIC Numeric
Status Enum (Active\Inactive)

Courses
CourseId String
CourseName String
Description Enum
Status Enum (Active\Inactive)

StudentCourses
StudentId (From: StudentInformation table) String
CourseId (From: Courses Table) String
CourseName Only For Display
StartDate Date
EndDate Date
Status Enum (Open\Pass\Fail)

Microsoft Dynamics Ax 2012 R3 Development Overview Page 4 of


12
Creating EDTs
First up need to analyze the number of EDT’s require to create in system. Use the
following steps to create EDTs for above mentioned tables.

Step by Step:
1. Open a new development workspace.
2. In the AOT, expand the Data Dictionary node.
3. Right-click the Extended Data Types node.
4. Select New > String. A new EDT called Type1 is created.
5. Right-click Type1 and select Properties.
6. Modify the property Name to StudentId.
7. Modify the property Extends to SysGroup.
8. Modify the property Label to Student Id.
9. Close the property sheet and click Save in the AOT to save your changes.
10. On the Database Synchronization dialog, click Yes.

Challenge Yourself:
Repeat same steps of for all different types of EDTs required for tables. For Base Enum
EDT, first Base Enum need to be created and then Set “Enum Type” field of that EDT with
newly created base Enum.

Creating BaseEnums

Step by Step:
1. Open a new development workspace.
2. In the AOT, expand the Data Dictionary node.
3. Right-click the Base Enum node.
4. Select New BaseEnum. A new BaseEnum called BaseEnum1 is created.
5. Right-click BaseEnum1 and select Properties.
6. Modify the property Name to Status.
7. Modify the property Label to Status.
8. Right-click the Status baseenum > New Element
i. A new element under Status BaseEnum will be added.
ii. Modify the property Name to Active
iii. Modify the property Label to Active.
Microsoft Dynamics Ax 2012 R3 Development Overview Page 5 of
12
iv. Similarly add new element “Inactive”.
9. Close the property sheet and click Save in the AOT to save your changes.

Challenge Yourself:
Repeat same steps of for all different types of BaseEnum required for EDTs.

Creating Tables

Step by Step:
1. Open a new development workspace.
2. In the AOT, expand the Data Dictionary node.
3. Right-click on the Tables node and select New Table. A new Table called
Table1 is created.
4. Right-click Table1 and select Properties.
5. Modify the property Name to StudentInformation.
6. Modify the property Label to Student Information.
7. Close the property sheet.
8. Press Ctrl-D to open another AOT. Ensure window is not maximized by
clicking the restore down button to enable you to view both AOT windows.
9. Expand the Data Dictionary node.
10. Expand the Extended Data Types node.
11. Locate the StudentId EDT.
12. Drag the StudentId EDT to the Fields node of the StudentInformation table.
A new field called StudentId is created.
13. Right-click the StudentId field and click Properties.
14. Note that the Extended Data type for this field is set to StudentId.
15. In the Name property, set the name of the field to StudentId.
16. Close the property sheet.

Challenge Yourself:
Repeat same steps of for all required fields for a Table. Create other tables using same
steps.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 6 of


12
Creating an Index

Step by Step:
1. Locate the StudentInformation table in the AOT.
2. Right-click the Indexes node in the table and select New Index. A new index
Index1 is created.
3. Rename the index to StudentIdx.
4. Drag the field StudentId to the index StudentIdx node.
5. In the properties sheet for the StudentIdx node, set the property
AllowDuplicates to No.
6. Close the property sheet.

Primary Index:
1. In the property sheet for the table StudentInformation, set the PrimaryIndex
property on the table to StudentIdx.
2. Close the property sheet for the table.

Challenge Yourself:
Repeat same steps to create and set Index\Primary Index for other tables.

Creating a Relation

Step by Step:
1. Open a new development workspace.
2. In the AOT, expand the Data Dictionary node.
3. Locate Table StudentCourses under Tables node.
4. Right-click the Relations node and select New Relation.
5. In the properties sheet for the new relation, set the Name property to
6. StudentInformationTable and the Table property to StudentInformation.
7. Right-click the StudentInformationTable relation, select New > Foreign Key >
PrimayKey Based.
8. In the property sheet for the new PrimayKey Based relation, set the Field to
StudentId and the RelatedField to StudentId.
9. Save your changes.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 7 of


12
Challenge Yourself:
Repeat same steps to create Foreign Key relation with CourseId from Courses table.

Creating Delete Action

Step by Step:
1. Open a new development workspace.
2. In the AOT, expand the Data Dictionary node.
3. Locate Table StudentInformation under Tables node.
4. Right – click on DeleteActions node and select New DeleteAction.
5. Unknown delete action is created.
6. Go to Unknown delete action properties and give Target table
StudentCourses.
7. In DeleteAction property select Casecade.
8. Save your changes.

Challenge Yourself:
Repeat same steps to create Relation on Courses table with StudentCourse table.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 8 of


12
LAB – AOT Query & View

Creating AOT Query

Step by Step:
1. Open a new development workspace.
2. In the AOT, go to Query node.
3. Right – click on Query node and select New Query.
4. Query1 is created.
5. Modify the property Name to StudentInformation.
6. Modify the property Title to Student Information.
7. Go to Unknown delete action properties and give Target table
StudentCourses.
8. In DeleteAction property select Casecade.
9. Save your changes.
10. Locate StudentInformation table under DataDictionary > Tables node.
11. Drag StudentInformation table and drop under Data Sources node under
StudentInformation AOT Query.
12. Modify Dynamics property of Fields node as Yes. This will expose all table
fields to AOT query.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 9 of


12
Creating AOT View

Step by Step:
1. Press Ctrl+D to open the AOT.
2. Expand the Data Dictionary node.
3. Right-click Views, and then click New View. A view is added to the list of views in the
AOT.
4. Expand the new view, right-click the view, and then click Properties. The properties
window opens and displays the view properties. Set the property values as shown in
the following table.

Property Value

Label Specify a label for the view.

Name Specify a name for the new view. You name it StudentInfoView.

5. Press Ctrl+D to open a second AOT window.


6. In the second AOT, expand the Tables node.
7. Drag a table StudentInformation onto the Metadata node of the new view in the first
AOT.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 10 of


12
If you click on the data source name, you can see how the Table property of the new
view is populated with the name of the table. The table is the data source for the new
view.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 11 of


12
LAB – User Interface

Creating Student ListPage

Step by Step:

1. Press Ctrl+D to open the AOT.


2. Go to Form node. Right Click > New from Form Template > ListPage.
3. New window with form name “CopyOfSysBPStyle_ListPage1” will open.
4. Modify the Name property of form to “StudentListPage”.
5. In the same form click on DataSource node.
6. Modify the Query property with “StudentInformation”.
7.
8. Open a new development workspace.
9. In the AOT, go to Query node and find “StudentInformation” query.
10.

Microsoft Dynamics Ax 2012 R3 Development Overview Page 12 of


12

Das könnte Ihnen auch gefallen