How to: Create a View Based on Tables or Other Views
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
In Microsoft Dynamics AX, a view is a virtual table whose contents are defined by one or more sources of data. The sources of data can include queries, tables or views. For more information about how a view retrieves data, see View Basics.
Views are created in the Application Object Tree (AOT). Before you create a view, identify the tables or views that can provide the data records and fields that you want the new view to return.
Create a View From a Table
Press Ctrl+D to open the AOT.
Expand the Data Dictionary node.
Right-click Views, and then click New View. A view is added to the list of views in the AOT.
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.
Press Ctrl+D to open a second AOT window.
In the second AOT, expand the Tables node.
Drag a table onto the Metadata node of the new view in the first AOT.
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.
Create a View From Another View
Under the Metadata node, right-click the table node that you just added, and then click Delete.
In the second AOT window, expand the Views node, and then drag a view onto the Metadata node of the new view.
If you click on the data source name, you can see how the Table property of the view is populated with the name of the view you dragged in. The table that it draws from is shown as well, in parentheses. The table provides the data source information for the view, which in turn provides the data for your new view.
Click the new view to display the view properties in the properties window. Set values for the following properties.
Property
Value
TitleField1
Specify a field to display in the window caption for the new view.
TitleField2
Specify a field to display in the window caption for the new view.
Right-click the new view in the AOT, and then click Save.
You can create another view, and repeat the previous steps to nest one view within another.
Test the View
The view is complete and ready to use. To see the data that the view returns, right-click the view in the AOT, and then click Open. The Table browser window opens and displays the view data. Use the Table browser to verify that the view returns the expected data records and fields.
See also
How to: Create a View Based on a Query
How to: Create Queries by using the AOT
Walkthrough: Creating a Form by Using the AOT
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.