Walkthrough: Create a Form that Has Tabbed Pages
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 Feature Pack, Microsoft Dynamics AX 2012
To create a form with tabbed pages, you use the AOT to create a Tab control as a placeholder for the tabbed page. You then create the tab page that appears in the tab.
Create the Form
In the AOT, right-click Forms, and then click New Form. A form is added to the Forms node.
Right-click the new form and then click Properties. In the Properties window, click Name and type MyNewForm.
Add a Data Source to the Form
Expand MyNewForm so that the Data Sources and Designs nodes are visible.
Press Ctrl + D to open a second AOT.
In the second AOT, expand AOT > Data Dictionary > Tables to see the list of tables.
From the second AOT, drag AssetTable onto the Data Sources node of the form.
Note
You can also create a form data source by right-clicking the Data Sources node of MyNewForm, and then clicking New DataSource. Use the Table property to select AssetTable.
Click the data source for the form. In the Properties window, click Name and type DataSourceAssetTable.
Add Tabs to the Form
Expand the Designs and Design nodes of MyNewForm. Click Caption and type Assets. The value of the Caption property appears in the titlebar of the form.
Click TitleDatasource and select DataSourceAssetTable from the drop-down list.
Right-click Design, click New Control, and then click Tab.
Click the tab that appears in the Design node. In the Properties window, click Width and select Column width. In addition, click Height and select Column height.
Right-click the Tab you added, and then click New Control > TabPage. Click the new tab page. In the Properties window click Name and type TabPage1. Click Caption and type Tab Page 1.
To create a second tab page, repeat this step. Use TabPage2 for the Name and Tab Page 2 for the Caption of the second tab page.
Add a Data Grid to a Tab Page
You use a grid to list the records from the AssetTable.
Right-click TabPage1, click New Control and then click Grid. A grid appears in the tab page.
Under the TabPage1 node, click the grid. In the Properties window, click Width and select Column width. Click Height and select Column height.
In MyNewForm, expand Data Sources > DataSourceAssetTable. Right-click Fields and then click Open New Window. The field list opens in a new AOT window.
In the AOT window that list fields, press Ctrl and then click AssetId, Name, SerialNum, and Model. Drag the highlighted fields to the Grid in the Design node of MyNewForm.
Add Field Groups to a Tab Page
You use field groups to supply detailed information about the highlighted record that appears in the list on the first tab.
Click TabPage2 in the Design node of MyNewForm.
In the AOT window that list fields, press Ctrl and then click Description, Inventory, and Model field groups. Drag the highlighted field groups to the TabPage2.
To save your changes, right-click the form, and then click Save.
Test the Form
Verify that the Data Sources and Design nodes of the form match what is shown in the following screen shot
MyNewForm in the AOT
To view the form, right-click MyNewForm, and then click Open. The form you see should match the structure in the following image. Your data is probably different depending on the table that you chose for this walkthrough.
The form with output
See also
Customizing Forms by Using the AOT
How to: Add a Part to the FactBox Pane
Announcements: New book: "Inside Microsoft Dynamics AX 2012 R3" now available. Get your copy at the MS Press Store.