How to: Create a View Based on Tables or Other Views [AX 2012]

Updated: June 3, 2011

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.

  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.

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

  6. In the second AOT, expand the Tables node.

  7. 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.

  1. Under the Metadata node, right-click the table node that you just added, and then click Delete.

  2. 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.

  3. 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.

  4. 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.

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.


Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.
Show: