Walkthrough: Creating a Document Page

In Microsoft Dynamics NAV, a document page consists of two separate pages, with one page nested inside the other page. The Header and Line form in the Classic client provides similar functionality by combining a main form with a subform.

You can create a document page if you have two tables that are linked. For example, page 42, Sales Order, has two source tables: Sales Header and Sales Lines. These two tables are linked in a one-to-many relationship and are ideal source tables for the Sales Order page.

The Sales Order document page consists of a series of FastTabs that display customer, invoicing, shipping, and other relevant information. The source table for this information is table 36, Sales Header. The lines that show items associated with each customer are based on table 37, Sales Lines.


In this walkthrough, you will create a sales order document page for Susan, the order processor. This page is essential to Susan’s daily work, because she uses sales orders to create and track all her customer orders from the creation of the first quote to when the order is shipped. This page also contains useful secondary information, such as customer statistics, in FactBoxes to the right of the main content area. For example, a Factbox can be added that is updated every time you select a line.

This walkthrough provides an overview of how to create a sales order document page with Page Designer.

The walkthrough illustrates the following tasks:

  • Creating a document page

  • Adding controls to display fields from the Sales Header table

  • Adding a Part Control to display sales lines

  • Adding a FactBox that is linked to sales lines

  • Running the page

Simon is a partner working for CRONUS International Ltd. Susan asks Simon to create a sales order page for her that can display each of her customers and any associated orders. Simon knows that this page must be based on two related source tables and that he must create a page using the document page type.


The following prerequisites are required for this walkthrough:

  • Microsoft Dynamics NAV 2009 installed with a developer license.

First, Simon creates a new document page that is based on table 36, Sales Header.


In this walkthrough, to learn about the properties and controls of a document page, you will create document page from a blank page. If you are running Microsoft Dynamics NAV 2009 SP1, Object Designer also includes a wizard that you can use to create a document page that will set up many properties and controls for you. For more information about the wizard, see How to: Create a Page.

To create a document page

  1. In the Classic client, on the Tools menu, click Object Designer.

  2. In Object Designer, click Page, and then click New. The New Page dialog box appears.

  3. In the Table text box, click the AssistButton, select the table 36, Sales Header, and then click OK.

  4. Click Create blank page, and then click OK.

    The new page appears in Page Designer.

  5. In the Name field of the first row, which has the type Container and the subtype ContentArea, type Susan's Sales Order Page.

  6. Select a blank row, and on the View menu, click Properties.

  7. Locate the PageType property, and then set the Value field to the page type Document.

  8. Close the Properties window.

  9. In the next row in Page Designer, in the Name field, type General.

  10. Set the Type property to Group and the SubType property to Group.

  11. On the File menu, click Save. Name your new page Susan's Sales Order Page. Set the ID field to 50006.

Simon now wants to add fields to his document page. He creates a group called General and adds fields from the Sales Header table. He knows that the main content area on a document page displays fields as FastTabs in the RoleTailored client.

To add a control to display fields from the Sales Header table

  1. In Page Designer, select the next empty row below the General group and set the Type property to Field.

  2. Select the row, and on the View menu, click Field Menu. The Field Menu displays all fields that are available in the Sales Header table.

  3. Press the CTRL key and select the following rows:

    • Sell-to Customer No.

    • No.

    • Sell-to Customer Name

    • Sell-to Address

    • Sell-to Address 2

    • Sell-to City

    • Sell-to Contact

  4. Click OK, and then click Yes to add the fields to your page.


    If the OK and Cancel buttons are unavailable, see Page Designer Troubleshooting for more information.

  5. On the File menu, click Save.

  6. In the Save dialog box, make sure Compiled is selected, and then click OK.

Simon's next task is to add a nested control to display lines from the Sales Lines table and the Sales Order Subform page. To do this, he must add a Part control to his page and link both objects using the Properties window.

To add a part control to display sales lines

  1. In Page Designer, select the next empty row below the General group and set the Type property to Part.

  2. In the Name field, type Sales Lines. Click anywhere outside this field, and Caption is filled in automatically.

  3. Select the Sales Lines row, and on the View menu, click Properties.

  4. In the Properties window, you can view the properties of the Sales Lines control. Set two properties here to configure your link to the Sales Lines table and page 46, Sales Order Subform:

    • PagePartID

    • SubFormLink

  5. To set the PagePartID property, in the Properties window, click the AssistButton next to this property.

  6. In the Page List window, select page 46, Sales Order Subform, and then click OK.

  7. To set the SubFormLink property, click the drill-down control to open the Table Filter window.

  8. In the first row, click Field to open the Sales Line - Field List window. This window enables you to set a table filter on the Sales Lines table.

  9. Select Document No., and then click OK.

  10. In the Type drop-down, click FIELD.

  11. In the Value field, click the AssistButton, select No., and then click OK.

  12. In the Table Filter window, click OK to add this filter value to the SubFormLink property.

  13. Use the left and right arrows to indent Sales Lines so that it matches the General group element.

Simon has already created two FactBoxes for his Sales Order page. He now wants to link the Sales Line FactBox to the Sales Lines table on his document page. To do this, he must change the ProviderID property on his FactBox part after he has added it to the page.

To add a FactBox that is linked to lines

  1. In Page Designer, select the next empty row.

  2. Set the Type field to Container, and then set the SubType field to FactBoxArea. Accept the default values for the Name and Caption fields.

  3. In the next row, type SalesLineFactBox in the Name field, and then set the Type field to Part.


    When you select the Part field as Type, you cannot select a SubType.

  4. On the View menu, click Properties.

  5. In the Properties window, select the PagePartID property, and then click the AssistButton. Select page 9087, Sales Lines FactBox, from the Page List window, and then click OK.

  6. To create a link between the FactBox and Sales Lines, you must first find the ID property of the Sales Lines row. To do this, select the Sales Lines row, and view the Properties window. In this example, the ID property of the Sales Lines row is 12. Select the SalesLineFactBox and set the ProviderID property to 12.


    The ID property of the Sales Lines row can vary, so check this carefully. Do not use the value mentioned in this example.

  7. In the SubFormLink property, enter the following table filter.

    Document Type=FIELD(Document Type),Document No.=FIELD(Document No.),Line No.=FIELD(Line No.)

  8. Close the Properties window.

  9. Check the indentation on your FactBox. Indentation of your FactBox container should match the first element in the page so that there is no indentation. Your SalesLineFactBox part should be indented by one space below the FactBox container.

    In Page Designer, your Document page should look like the following illustration.

  10. Close Page Designer, and then click Yes to save your page.

Test your new document page in the RoleTailored client.

To run the page

  1. On the taskbar, click Start, and then click Run.

  2. Enter the following command to display your page:


    The RoleTailored client opens and displays the new document page.

Simon now wants to add actions to Susan's document page and promote some of these actions to the Action Pane.

Community Additions