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.
About This Walkthrough
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
Story
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.
Prerequisites
The following prerequisites are required for this
walkthrough:
Creating a Document Page
First, Simon creates a new document page that is based on table
36, Sales Header.
Note |
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
-
In the Classic client, on the Tools menu, click Object
Designer.
-
In Object Designer, click Page, and then click
New. The New Page dialog box appears.
-
In the Table text box, click the AssistButton,
select the table 36, Sales Header, and then click
OK.
-
Click Create blank page, and then click OK.
The new page appears in Page Designer.
-
In the Name field of the first row, which has the type
Container and the subtype ContentArea, type
Susan's Sales Order Page.
-
Select a blank row, and on the View menu, click
Properties.
-
Locate the PageType property, and then set the
Value field to the page type Document.
-
Close the Properties window.
-
In the next row in Page Designer, in the Name field, type
General.
-
Set the Type property to Group and the
SubType property to Group.
-
On the File menu, click Save. Name your new page
Susan's Sales Order Page. Set the ID field to
50006.
Adding a Control to Display Fields
from the Sales Header Table
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
-
In Page Designer, select the next empty row below the
General group and set the Type property to
Field.
-
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.
-
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
-
Click OK, and then click Yes to add the fields to
your page.
-
On the File menu, click Save.
-
In the Save dialog box, make sure Compiled is
selected, and then click OK.
Adding a Part Control to Display
Sales Lines
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
-
In Page Designer, select the next empty row below the
General group and set the Type property to
Part.
-
In the Name field, type Sales Lines. Click
anywhere outside this field, and Caption is filled in
automatically.
-
Select the Sales Lines row, and on the View menu,
click Properties.
-
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:
-
To set the PagePartID property, in the Properties
window, click the AssistButton next to this property.
-
In the Page List window, select page 46, Sales Order
Subform, and then click OK.
-
To set the SubFormLink property, click the drill-down
control to open the Table Filter window.
-
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.
-
Select Document No., and then click OK.
-
In the Type drop-down, click FIELD.
-
In the Value field, click the AssistButton, select
No., and then click OK.
-
In the Table Filter window, click OK to add this
filter value to the SubFormLink property.
-
Use the left and right arrows to indent Sales Lines so
that it matches the General group element.
Adding a FactBox That Is Linked to
Lines
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
-
In Page Designer, select the next empty row.
-
Set the Type field to Container, and then set the
SubType field to FactBoxArea. Accept the default
values for the Name and Caption fields.
-
In the next row, type SalesLineFactBox in the Name
field, and then set the Type field to Part.
Note |
When you select the Part field as Type, you cannot
select a SubType.
|
-
On the View menu, click Properties.
-
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.
-
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.
Note |
The ID property of the Sales Lines row can vary, so check this
carefully. Do not use the value mentioned in this example.
|
-
In the SubFormLink property, enter the following table
filter.
Document Type=FIELD(Document Type),Document
No.=FIELD(Document No.),Line No.=FIELD(Line No.)
-
Close the Properties window.
-
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.
-
Close Page Designer, and then click Yes to save your
page.
Running the Page
Test your new document page in the RoleTailored client.
To run the page
-
On the taskbar, click Start, and then click
Run.
-
Enter the following command to display your page:
DynamicsNav:////runpage?page=<pageid>
The RoleTailored client opens and displays the new document
page.
Next Steps
Simon now wants to add actions to Susan's document page and
promote some of these actions to the Action Pane.
See Also