Top Banner
Chapter 4: Pages 4-1 CHAPTER 4: PAGES Objectives The objectives are: Understand the concepts of pages and page components. Describe Page Designer and Action Designer. Create a simple page and add basic controls to the page. Provide an overview of different page types and their characteristics. Discuss best practices in designing pages. Create a Card page, add a container, FastTabs and fields. Create a List page and link it to the Card page. Create a main page, a Part page and link the two pages. Introduction In Microsoft Dynamics ® NAV 2009, pages replace forms as the main way to display, enter and modify data. Pages provide an easy way to create a task- oriented, professional looking and dynamic user interface. Pages are used in the Microsoft Dynamics NAV RoleTailored client. Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement
46

Na2009 enus devi_04

Nov 07, 2014

Download

Technology

Peter Muscat

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Na2009 enus devi_04

Chapter 4: Pages

4-1

CHAPTER 4: PAGES Objectives

The objectives are:

• Understand the concepts of pages and page components. • Describe Page Designer and Action Designer. • Create a simple page and add basic controls to the page. • Provide an overview of different page types and their characteristics. • Discuss best practices in designing pages. • Create a Card page, add a container, FastTabs and fields. • Create a List page and link it to the Card page. • Create a main page, a Part page and link the two pages.

Introduction In Microsoft Dynamics® NAV 2009, pages replace forms as the main way to display, enter and modify data. Pages provide an easy way to create a task-oriented, professional looking and dynamic user interface.

Pages are used in the Microsoft Dynamics NAV RoleTailored client.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 2: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-2

Page Fundamentals The main difference between forms and pages is that events and application logic called by pages are run on the Microsoft Dynamics NAV Service instead of on the client. These make Microsoft Dynamics NAV 2009 a much more secure, scalable and flexible application.

The following shows components of a page and how they are related.

FIGURE 4.1 PAGE COMPONENTS AND THEIR RELATION

Pages are created and designed in the Page Designer that is accessed from the Microsoft Dynamics NAV Classic client.

Properties

Page properties describe how a page behaves when it is displayed by the RoleTailored client. Pages have less properties than forms, and some are used in a similar manner, such as ID, Name, Caption and SourceTable. Pages also have distinct properties that are not available in forms, they are as follows:

• PageType • CardFormID • InstructionalTextML • LinksAllowed

Page properties are defined on the Properties window that can be edited when the page is opened in the Page Designer.

The following steps show how to open the Properties window for the Customer Card page.

In Microsoft Dynamics NAV Classic client:

1. On the Tools menu, click Object Designer. The Object Designer opens.

2. Click the Page button to open the Page list.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 3: Na2009 enus devi_04

Chapter 4: Pages

4-3

3. Select page 21, Customer Card, and then click the Design button to design the Customer Card page. The Page Designer opens.

4. Scroll down to the blank line at the bottom of the page, and click View, Properties, or click the Properties button on the Toolbar.

NOTE: Alternatively, right-click the blank line at the bottom of the page, and then click Properties.

5. The Page - Properties window opens and shows the properties for the page. Here developers can view and modify properties for the Customer Card page.

FIGURE 4.2 THE CUSTOMER CARD PAGE AND ITS PROPERTIES

Triggers

Triggers in pages work exactly like they do in forms. However, some triggers are not supported in the RoleTailored client. When upgrading from an earlier version of Microsoft Navision or Microsoft Dynamics NAV the transformation process converts all C/AL code to C# automatically and removes unsupported triggers.

Pages contain fewer triggers than forms for two reasons:

• The RoleTailored client has improved behavior that is implemented directly into the controls that run on it. Some code previously necessary is now obsolete.

• Pages are designed to optimize performance. This reduces requirements for existing form triggers.

Triggers in a page can be divided into three categories:

• Page triggers • Control triggers • Action triggers

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 4: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-4

Examples of page triggers include OnOpenPage which contains statements that are executed when the page is opened, and OnModifyRecord which contains statements that are executed before the system accepts changes the user makes to a record. Triggers in a page are edited in the C/AL Editor which is accessed from the Page Designer.

Controls

Page controls, just as form controls, are used to display data from the following:

• A database table field. • The value of a C/AL expression. • Bitmap pictures. • Static information such as a descriptive text.

The concept of bound and unbound controls remains the same as in forms.

There are several new controls available in pages and some which are re-implemented for the RoleTailored client. New page controls include the following:

• FactBoxes • FastTabs • Cues

Depending on the page type, each page has a specific set of controls that is available only for that page. For example Cues are only used on Role Center pages and FastTabs are only used on Card and Document pages.

Control Properties

Use page control properties to link controls to underlying tables and to determine what happens when information is entered into a field. Different page controls can have different sets of properties. For example, container, group and field controls, each have their own unique sets of properties.

Unlike form control properties, page control properties do not describe how a control is positioned as an X and Y position.

Page control properties are defined on the Properties window that can be edited when the page is opened in the Page Designer.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 5: Na2009 enus devi_04

Chapter 4: Pages

4-5

The following steps show how to open the Properties window for one of the controls (the General FastTab) in the Customer Card page.

1. Design page 21, Customer Card, from the Object Designer. 2. Click the line General FastTab (the line that has Caption General -

the second line from the top) and click View, Properties, or click the Properties button on the Toolbar.

NOTE: Alternatively, right-click the General line and click Properties.

3. The Properties window opens and shows the properties for the control. Here developers can view and modify properties for the General FastTab.

FIGURE 4.3 THE GENERAL FASTTAB PROPERTIES

Expression as Property Value

Several control properties allow for expressions as their value. This enables dynamic appearance of these controls, depending on the value of expression. For example, in a form, a text box control has a Visible property and its value is limited to Yes or No.

In a page, a field's Visible property value is an expression. The field's visibility can be controlled by assigning an expression that returns TRUE or FALSE to its Visible property. The default value of properties that accept expression is <TRUE> instead of <Yes>.

Control Triggers

In pages, only field type controls and action controls have triggers.

The following steps show how to view the triggers for the No. field in the Customer Card page.

1. Design page 21, Customer Card, from the Object Designer. 2. Click the No. field (the line that has SourceExpr No. - the third line

from the top) and click View, C/AL Code, or click the C/AL Code button on the Toolbar.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 6: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-6

NOTE: Alternatively, right-click the No. field and then click CAL Code.

3. The C/AL Editor opens and shows the triggers for the No. field. Here developers can write C/AL statements to program certain activities when the any particular trigger is executed, for example, when the No. field is modified.

NOTE: The triggers for the Customer Card page are also shown together with the triggers for the No. field.

FIGURE 4.4 THE NO. FIELD TRIGGERS AND THE CUSTOMER CARD PAGE TRIGGERS

Actions

In the RoleTailored client for Microsoft Dynamics NAV, menu items are known as actions. Actions are displayed at the top of each page.

Actions are created and modified from the Action Designer that is accessed from the Page Designer. Actions have their own properties and triggers, which can be accessed from the Action Designer.

There are two locations to add Actions, in the page itself and in Cues.

The following steps show how to open the Action Designer and view the properties and triggers of an action in the Customer Card page.

1. Design page 21, Customer Card, from the Object Designer. 2. Scroll down to the blank line at the bottom of the page, and click

View, Actions.

NOTE: Alternatively, right-click the blank line at the bottom of the page, and then click Actions.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 7: Na2009 enus devi_04

Chapter 4: Pages

4-7

3. The Action Designer opens and shows all the Action controls in the Customer Card page.

FIGURE 4.5 THE ACTION DESIGNER

4. Click any of the Action (any of the line), and then click View,

Properties. The Properties window opens and shows the properties for the current Action.

5. Close the Properties window. 6. Click any of the Action, and then click View, C/AL Code. The

C/AL Editor opens and shows the triggers for the current Action.

Action Properties

Action properties let a developer/administrator/super user change an action and decide how it is displayed in the RoleTailored client. For example, changing Promoted property from No to Yes promotes an action to the Action Pane. This makes it more prominent to end-users.

The following properties change the way an action is displayed:

Action Property Purpose

Caption Set the name of the Action that appears in the RoleTailored client.

Promoted Promotes an action to the Actions Pane.

PromotedIsBig Increases the size of the promoted action icon.

PromotedCategory Determines the Actions Pane category. There are three categories to select from: New, Process, or Report.

Image Lets an image to be associated with an Action.

Similar to page controls, some property value of action controls can be assigned to expressions instead of static selection of values. This enables multiple actions to be dynamically hidden/shown, depending on certain criteria. A good example for this usage is page 6510, Item Tracking Lines.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 8: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-8

Action properties also define what activity is performed when users click the action, for example, the RunObject, RunFormLink and RunFormMode property. The concept is similar to the same properties in command button controls in forms.

Page Designer In Microsoft Dynamics NAV 2009, the introduction of the three-tier architecture together with the new RoleTailored client has entailed implementing some far-reaching changes in the C/SIDE development environment. A new Page Designer is introduced to design, create and modify pages.

Page Designer is accessed from the Object Designer. This means development is still done in the Object Designer on the Classic client that accesses the database directly and does not use the Microsoft Dynamics NAV Service. After designing pages in the Page Designer, developers save and compile objects in the usual manner and test the results in the RoleTailored client.

The RoleTailored client for Microsoft Dynamics NAV displays data in pages. There are several different types of pages, such as List, Card and Role Center pages.

Control Type and Subtype

When designing a page, developers specify a hierarchy of page elements and decide which data is displayed by each element instead of positioning controls on forms by specifying the X and Y coordinates. This frees developers from the tedious pixel-level editing and the static layout of Form Designer. The central activity in page design is specifying the contents of the page in relation to the different Microsoft Dynamics NAV page types such as List, Card, Journal, and Worksheet.

In turn, when end-users view the pages and interact with the application, they can personalize the appearance of the parts of the application that they have access to. End-users can specify both the placement and the appearance of the elements within the page hierarchy that is defined by the developer/administrator/super user. Microsoft Dynamics NAV 2009 contains more personalization options than earlier versions of Microsoft Navision or Microsoft Dynamics NAV.

There are several types of controls that can be added to a page. The following list groups controls into several broad categories.

Type Purpose

Container Act like a placeholder for other controls.

Group Arrange other controls in a logical manner.

Field The actual control that displays information.

Part Display another page, chart or system part in a page.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 9: Na2009 enus devi_04

Chapter 4: Pages

4-9

Every page element is a control with a specific type and subtype and every page has a container control to start with. There are three subtypes of container, they are as follows:

Subtype Purpose

ContentArea General usage. An ordinary page (non-role center) has this as the top most element.

RoleCenterArea Used for RoleCenter Page, instead of ContentArea.

FactboxArea Used to define FactBox controls in a page.

Every page must have at least a container control as the top most element.

The next control type is group. Group control is used to group several other controls together. There are four group subtypes, they are as follows:

Subtype Purpose Group Create FastTabs in card pages or group several controls

together.

Repeater Present data in a tabular format, such as in list page.

CueGroup Create Cues, such as in the SO Processor Activities page.

FixedLayout Fix layout of other controls, such as controls in the bottom section of Journals, example General Journals.

The other two control types are field and part. They do not have a subtype.

Field control is the smallest entity in page elements. It is the actual control that is used to display:

• A database table field. • The value of a C/AL expression. • Bitmap pictures. • Static information such as a descriptive text.

Part control is used to show another page or system data as a part of the current page. There are several important properties for Part, namely:

• PartType • PagePartID • SystemPartID • ChartPartID

These properties define what kind of part is displayed in the page.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 10: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-10

Action Designer

In the RoleTailored client, each page has its own set of actions that appear in action menus under the command bar and in the Action Pane.

Actions can be role specific and they make frequently used data easily accessed by users.

The Action Pane contains actions that are especially important for users in the given context and therefore are promoted. It appears above the command bar and contains duplicates of actions from the action menus. In this manner, users can always find commands that are promoted even if the Action Pane is collapsed. The Action Pane is optional in Microsoft Dynamics NAV 2009. If no actions are promoted, then it collapses by default.

For example, the Customer List page has three action menus:

• Actions • Related Information • Reports

The Customer List page also has three groups of promoted actions in the Action Pane, which are as follows:

• New • Process • Reports

FIGURE 4.6 THE CUSTOMER LIST PAGE

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 11: Na2009 enus devi_04

Chapter 4: Pages

4-11

In addition to these actions that are located in the page itself, actions can also be positioned in a Cue. The Order Processor Role Center has an activities section which has several Cues with several actions.

FIGURE 4.7 THE ORDER PROCESSOR ROLE CENTER PAGE

When users click an action, another page is displayed or other functionality is triggered, such as displaying a preview of a report. Much of this functionality can be controlled by changing the action properties of the action in the action designer.

Users are also able to customize actions by using the personalization dialogs that are available in the RoleTailored client.

Some actions are generated by the system, such as View, Edit, New and Delete and cannot be changed, whereas other actions can be added or removed by an administrator/super user from the existing list by using the Action Designer.

The Action Designer is accessed from the Page Designer.

Action Type and Subtype

There are four types of action in page objects, they are as follows:

• Action Container • Action • Separator • Action Group

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 12: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-12

Action Container is the top level element in the hierarchy and must always have a subtype. Other action types that sit under it do not have subtypes. Subtype is used to decide where in the page, an action will be positioned. Depending on the subtype, action can be put in the following positions:

Subtype Where it is positioned Where used Figure 4.8

NewDocumentItems Action menu, Actions/New Document

All pages 1

ActionItems Action menu, Actions, under Links

All pages 2

RelatedInformation Action menu, Related Information

All pages 3

Reports Action menu, Reports All pages 4

HomeItems Navigation pane, Home panel Role Centers 5

ActivityButtons Navigation pane, under Home panel

Role Centers 6

FIGURE 4.8 ACTION CONTROL POSITIONING

Action Containers must be unique in a page. There cannot be two Action Containers with the same subtype. For example, there can only be one Action Container with the Reports subtype.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 13: Na2009 enus devi_04

Chapter 4: Pages

4-13

Action Container must not be indented. Other Actions that sit under the Action Container must be one level indented or more, depending on its placement in the hierarchy.

Action Group is used to group several actions that are related. For example, in Customer List page, several actions that show different information about a particular customer (Ledger Entries, Issued Documents and Bank Accounts) are grouped into Customer Action Group.

Separator is a special type of action that does nothing. It is used to create a horizontal line to divide actions in the action menu.

The action that represents the command itself is defined by using the Action type. An action with the Action type can be used to open another page, preview a report or run a C/AL code defined in the action triggers.

Demonstration: Create a Simple Page The following demonstration shows how to create a simple page, add basic controls to the page and how to work with some of their properties.

Create a Blank Page

The following steps show how to create a blank page.

1. In the Object Designer's Page list, click the New button. The New Page window opens.

2. Click OK to create a blank page. The Page designer opens. There is no element yet in the page.

3. Compile and save the page by clicking File, Save As. The Save As dialog box opens.

4. Type 90001 in the ID and Custom Page in the Name, ensure that the Compiled check box is selected, and then click OK. This compiles and saves the page.

5. Close the page by closing the Page Designer. 6. On the Windows taskbar, click Start and then click Run.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 14: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-14

7. In the Run window, type the following string: dynamicsnav:////runpage?page=90001, where 90001 is the ID of the Custom Page, and then click OK, to run the newly created Custom Page. This opens the Custom Page in the RoleTailored client.

FIGURE 4.9 THE CUSTOM PAGE WITHOUT ANY CONTROLS

8. Close the page.

Select the Page Type and Attach a Source Table

A blank page is unbound when it is created. It is not associated with any table. Also, a default page type (Card), is assigned to this page. The following steps show how to associate a blank page with a table and set the page type.

1. Design form 90001, Custom Page, from the Object Designer. 2. Open the Properties window for the page, and set the following

property: o PageType: Card o SourceTable: Item

NOTE: SourceTable property accepts either the ID or the name of the table.

FIGURE 4.10 THE PAGE PROPERTIES

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 15: Na2009 enus devi_04

Chapter 4: Pages

4-15

3. Close the Properties window. 4. Compile, save and close the page. 5. Run page 90001, Custom Page. Notice the value that is shown in the

title bar of the page. It shows the first item from the Item table.

FIGURE 4.11 THE CUSTOM PAGE WITH SOURCE TABLE ITEM

6. Close the page.

The Custom Page is now attached to the Item table. Unlike the Card form in the Classic client, where records can be travelled through by clicking the Next and Previous button, the Card page in the RoleTailored client shows only a single record. To move between records, use a List page, and then open the Card page for a specific record.

Add a Container

The Custom Page is useless without any controls in it. Every page that has controls must have a container control as the top most element of the page, in the Page Designer. The following steps show how to add a container to the page.

1. Design form 90001, Custom Page, from the Object Designer. 2. Type the following on the first line of the Page Designer:

Name Type SubType

Custom Page Container ContentArea

FIGURE 4.12 ADD A CONTAINER TO THE PAGE

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 16: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-16

Add a FastTab

FastTab is a new control introduced in Microsoft Dynamics NAV 2009. The concept is similar to a tab control in forms. These steps show how to add a FastTab to the Custom Page.

1. Go to the next blank line. The page elements automatically indent. 2. Type the following:

Caption Type SubType

General Group Group

This is the first FastTab in the page and it is named General.

FIGURE 4.13 ADD A FASTTAB TO THE PAGE

Add Simple Controls

Field controls are the actual controls that are used to display data. These steps show how to add several fields into the page.

1. Type the following on the next several lines and ensure that they are indented under the General FastTab:

Type SourceExpr

Field "No."

Field Description

Field "Costing Method"

Field "Profit %"

Field Picture

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 17: Na2009 enus devi_04

Chapter 4: Pages

4-17

NOTE: Instead of typing the SourceExpr, click the Assist-Edit button next to SourceExpr and select from the list of available options. Alternatively, use the Field Menu to select multiple fields at the same time.

FIGURE 4.14 ADD FIELDS TO THE PAGE

2. Compile, save and close the page. 3. Run the page and view the changes.

FIGURE 4.15 THE CUSTOM PAGE WITH SEVERAL CONTROLS

The RoleTailored client displays the fields according to their data type. The Costing Method field is displayed as a drop-down list, the Picture field is displayed as an image and the rest of the fields are displayed as text boxes. This is because the Costing Method is of type Option and the Picture field is of type BLOB. The RoleTailored client adds the labels to the controls and positions the fields automatically.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 18: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-18

ExtendedDataType

ExtendedDataType property is a new property introduced in Microsoft Dynamics NAV 2009. Depending on this property, the RoleTailored client displays fields differently to improve the user experience. The options available are as follows:

• None • Phone No. • Url • E-mail • Ratio

For example, a field that has ExtendedDataType property set to E-mail, located in a Card page, is displayed by the RoleTailored client together with a small e-mail button next to the field. When users click this button, the default e-mail client opens with the value from the field copied to the recipient list.

FIGURE 4.16 FIELDS WITH EXTENDEDDATATYPE PROPERTY SET IN THE CUSTOMER CARD PAGE

Display a Progress Indicator

An indicator creates a way for the user to easily view the percentage of a value in a graphical manner. The following steps show how to display a progress indicator for the profit of an item by setting the ExtendedDataType property.

1. Design form 90001, Custom Form, from the Object Designer. 2. Set the following properties for the Profit % field:

o MaxValue: The same value as the value of the same property of the Profit % field in the Item table

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 19: Na2009 enus devi_04

Chapter 4: Pages

4-19

o ExtendedDataType: Ratio

FIGURE 4.17 SET THE EXTENDEDDATATYPE PROPERTY

3. Close the Properties window. 4. Compile, save and close the page. 5. Run the page and view the changes.

FIGURE 4.18 THE CUSTOM PAGE WITH AN INDICATOR

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 20: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-20

Add a FixedLayout

A FixedLayout control is used to fix certain controls together in a matrix-like format. It is used mostly in statistics pages. The following shows how to add the information about quantity available in inventory, purchase order and several other documents, in a matrix-like format, by using a FixedLayout control.

1. Design page 90001, Custom Page, from the Object Designer. 2. Add a FastTab named Test Fixed Layout and indent it to the same

level as the General FastTab. 3. Type the following on the next several lines, under the Test Fixed

Layout FastTab:

Caption Type SubType SourceExpr Indent Group FixedLayout 1

Inventory Group Group 2

Quantity on... Field Inventory 3

Purch. Order Group Group 2

Field "Qty. on Purch. Order" 3

Prod. Order Group Group 2

Field "Qty. on Prod. Order" 3

Component Lines Group Group 2

Field "Qty. on Component Lines"

3

Sales Order Group Group 2

Field "Qty. on Sales Order" 3

Service Order Group Group 2

Field "Qty. on Service Order" 3

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 21: Na2009 enus devi_04

Chapter 4: Pages

4-21

The Indent column represents how many levels each rows are indented under the Test Fixed Layout FastTab. (The FixedLayout control is one level under the Test Fixed Layout FastTab and the Inventory Group is two levels under the Test Fix Layout FastTab and so on.)

FIGURE 4.19 ADD A FIXEDLAYOUT TO THE PAGE

4. Compile, save, and close the page. 5. Run the page and view the changes.

FIGURE 4.20 THE CUSTOM PAGE WITH A FIXEDLAYOUT

Add a Repeater

A repeater control enables the page to display more than one record at a time. The following steps show how to add a repeater to show multiple item records.

1. Design form 90001, Custom Form, from the Object Designer. 2. Add a FastTab named Test Repeater and indent it to the same level

as the General FastTab.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 22: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-22

3. Type the following on the next blank line to add the repeater and ensure that it is indented under the Test Repeater FastTab.

Type SubType

Group Repeater

NOTE: Adding a repeater to a Card page is not logical. Repeater control is used extensively in a List page. The steps here are only meant to demonstrate how to add and use the repeater control on a page.

Use the Field Menu

A repeater without field controls underneath it is like a table box without any text box in it. It shows a grid, without any columns. Add fields to under the repeater to show columns in the repeater. Use the Field Menu to efficiently add fields to a page.

1. Click View, Field Menu or click the Field Menu button on the Toolbar. The Field Menu window opens.

2. Select the No., Description, and Base Unit of Measure, and then click the line under the Repeater.

NOTE: Hold the CTRL key while selecting the fields in the Field Menu window to select multiple fields.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 23: Na2009 enus devi_04

Chapter 4: Pages

4-23

3. Click Yes for the confirmation message.

FIGURE 4.21 ADD REPEATER AND FIELDS

4. Compile, save, and close the page. 5. Run the page, and view the repeater under the Test Repeater

FastTab.

FIGURE 4.22 THE CUSTOM PAGE WITH REPEATER

The repeater displays several rows of records from the item table. The title bar of the form changes according to the row selected in the table box.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 24: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-24

Add Actions

The following steps show how to add an action that enables end-users to open a related report from the page.

1. Design form 90001, Custom Form, from the Object Designer. 2. Open the Action Designer for the page. 3. Type the following on the first line:

Type SubType

ActionContainer Reports

FIGURE 4.23 ADD AN ACTION CONTAINER

4. Go to the next blank line. The page element automatically indents. 5. Type the following:

Caption Type Inventory - List Action

FIGURE 4.24 ADD AN ACTION

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 25: Na2009 enus devi_04

Chapter 4: Pages

4-25

6. Open the Properties window for the action, and set the following properties: o RunObject: Report Inventory - List o Promoted: Yes o PromotedCategory: Reports

FIGURE 4.25 SET ACTION PROPERTIES

7. Close the Properties window and close the Action Designer. 8. Compile, save, and close the page. 9. Run the page and test the action.

FIGURE 4.26 THE CUSTOM PAGE WITH AN ACTION

Page Types and Characteristics Page type is a new concept introduced in Microsoft Dynamics NAV 2009. Although forms are also categorized in types, they are not strictly bound to these. Pages are different in this case. Pages are interpreted differently in the

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 26: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-26

RoleTailored client, depending on their page type. Each page type also has different sets of controls that it can use. This makes page type the most important concept to understand when designing pages.

Card Page

A Card page enables users to view and edit one record at a time. It is used when there are too many fields to view them all conveniently on only one line. A Card page always has FastTabs, instead of tabs. Even if there are few fields, there is at least one General FastTab, which is always first.

Tables that use Card pages only have one field in their Primary Key and this field is always displayed as the first field in the General FastTab.

Naming Card Pages

Card pages are named with the name of the associated table, followed by the word Card. For example, the card page associated with the Customer table is named Customer Card.

FIGURE 4.27 THE CUSTOMER CARD PAGE

List Page

A List page is a multi-record page that enables users to view multiple records from a table at the same time.

The Primary Key fields of the associated table are displayed in the left-most columns.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 27: Na2009 enus devi_04

Chapter 4: Pages

4-27

Naming List Pages

If the List page cannot be edited, it is named with the name of the associated table, followed by the word List. For example, the List page associated with the Customer table is named Customer List. If the List page can be edited, it is named with the plural of the name of the associated table. For example, the List page associated with the Currency table is named Currencies.

FIGURE 4.28 THE CUSTOMER LIST PAGE

CardPart Page

A CardPart page is used to display fields or a special control like a picture viewer, in a FactBox. Use a CardPart page to create a FactBox that has one column.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 28: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-28

Naming CardPart Pages

CardPart pages are named with the associated information, followed by the word FactBox. For example, the CardPart page that displays the sales history of the sell-to customer is named Sales Hist. Sell-to FactBox.

FIGURE 4.29 THE SALES HIST. SELL-TO FACTBOX PAGE

ListPart Page

A ListPart page is used to display fields or a special control like a picture viewer, in a FactBox. Use a ListPart page to create a FactBox that has multiple columns.

Naming ListPart Pages

ListPart pages are named with the associated information, followed by the word FactBox. For example, the ListPart page that displays the Dimensions is named Dimensions FactBox.

FIGURE 4.30 THE DIMENSIONS FACTBOX PAGE

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 29: Na2009 enus devi_04

Chapter 4: Pages

4-29

Worksheet Page

A Worksheet page is a multi-record page that enables users to view multiple records from a table and edit them. Worksheet pages differ from ordinary List pages, in that when the user inserts a new record, the record does not jump to another position within the page, but instead, the record stays in the same order in which the user inserted it. This order is done by using the AutoSplitKey property of the page, combined with an integer as the last field in the table's Primary Key.

The Primary Key fields of the associated table are not displayed on the Worksheet page.

Naming Worksheet Pages

Worksheet pages are named according to the purpose of the associated table. For example, for Journal tables, the name of the Worksheet page ends with the word Journal.

FIGURE 4.31 THE GENERAL JOURNAL PAGE

Document Page

A Document page is a page that contains a series of FastTabs and Lines on the same page. It behaves in a similar manner to a Header/Line form in the Classic client.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 30: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-30

Naming Document Pages

The name of the Document page is the name of the document that it represents. For example, Sales Invoice.

FIGURE 4.32 THE SALES INVOICE PAGE

Role Center Page

A Role Center page resembles a user home page that can be tailored to the needs of the user by adding different parts or controls. A Role Center page can contain a series of links to List pages in the Navigation Pane or can indicate to the user tasks that need their immediate attention, by using Cues in the Activity Centers. System parts can be used to display an Outlook Inbox or a Notes part and FactBoxes can be added to display important information, such as a list of customers.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 31: Na2009 enus devi_04

Chapter 4: Pages

4-31

Naming Role Center Pages

Role Center pages are named with the name of the associated role, tailored to them, followed by the word Role Center. For example, the Role Center page associated with the Order Processor role is named Order Processor Role Center.

FIGURE 4.33 THE ORDER PROCESSOR ROLE CENTER PAGE

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 32: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-32

Navigate Page

The Navigate system dialog page is used for making searches based on individual posting transactions, such as page 344, Navigate in the Classic client.

FIGURE 4.34 THE NAVIGATE PAGE

ConfirmationDialog Page

Use this page to ask the user a question that can be answered with minimal data input. Developers can add input fields so that users can decide how their answer should be formatted. If more than three or four fields are used in this page, consider using a task page instead.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 33: Na2009 enus devi_04

Chapter 4: Pages

4-33

ListPlus Page

A ListPlus page contains FastTabs at the top of the page and a list at the bottom. While Document page only contains one list at the bottom of the page, a ListPlus page contains multiple lists. For example, page 397, Sales Invoice Statistics.

FIGURE 4.35 THE SALES INVOICE STATISTICS PAGE

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 34: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-34

Design Pages: Best Practices After knowing the components that comprise a page and how they are defined in Page Designer, the following are some best practices when designing pages:

• Consider the types of users who use the new page and list the tasks that they perform.

• Create a list of the fields, commands and links needed for the page. • Select the page type that best matches the content displayed on the

page. • Set the source table of the page to the table that contains the primary

set of data that the page displays. • Design the page by using Page Designer by specifying a hierarchy of

page elements. Determine the details of how data is displayed by adjusting the properties of each element on the page.

• Consider any supplemental sources of information that add value to the page and add these as FactBoxes. Perhaps existing FactBoxes can support the design.

• Simplify the user experience by reducing what users view by default. This can be achieved by doing the following: o Promote Actions to appropriate groups with the appropriate

sequence and size. o Set the Importance property to Additional for fields that are used

less than three out of ten times. o Display one to three FactBoxes by default.

• Add the new page to the menu suite so that it is included on the

Departments page. • If the page is a list place, consider specific user profiles to have a

link to this page from their RoleCenter page. • If the page is a task page, consider which list places from which it is

useful to link to, and add the link.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 35: Na2009 enus devi_04

Chapter 4: Pages

4-35

Demonstration: Create a Card Page The following demonstration shows how to create a Card page, add several fields to the card form by using the Field Menu and add parts to the page.

Create a Blank Page

The following steps show how to create a Card page.

1. In the Object Designer's Page list, click the New button. The New Page window opens.

2. Type Customer in the Table field. 3. Select Create blank page of type, select Card, and then click OK.

FIGURE 4.36 THE NEW PAGE WINDOW

The Page Designer opens a blank page and automatically sets the Page Type property to Card.

Add a Container, FastTabs and Fields

The following steps show how to add a FastTab and Fields to the page.

1. Type the following on the first line of the Page Designer:

Name Type SubType

My Customer Page Container ContentArea

2. Go to the next blank line. The page elements automatically indent. 3. Type the following to add a FastTab named General:

Caption Type SubType

General Group Group

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 36: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-36

4. Click View, Field Menu or click the Field Menu button on the Toolbar. The Field Menu window opens.

5. Select the No., Name, Address, City and Balance, and then click the line under the General FastTab.

6. Click Yes for the confirmation message. 7. Go to the next blank line, and type the following to add another

FastTab named Others:

Caption Type SubType

Others Group Group

8. Indent the Others FastTab to the same level as the General FastTab. 9. Click View, Field Menu or click the Field Menu button on the

Toolbar, select the Territory Code, Global Dimension 1 Code, and Global Dimension 2 Code, and then click the line under the Others FastTab.

10. Click Yes for the confirmation message. 11. Compile and save the page with the ID 90002, and the name My

Customer Card, and close the page.

FIGURE 4.37 MY CUSTOMER CARD PAGE

12. Run the page, and test the FastTabs and fields.

Add Parts to the Page

Supplemental information such as the historical transaction for a Customer and Customer statistical information can be useful when viewing the page. FactBoxes give users a way to view this information as part of a page.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 37: Na2009 enus devi_04

Chapter 4: Pages

4-37

The following steps show how to add parts to a page:

1. Design page 90002, My Customer Page, from the Object Designer. 2. Go to the next blank line, and type the following:

Type SubType Container FactBoxArea

3. Indent it at the same level as the first container. 4. Go to the next line, and type Part as the Type. This add a part

control to the page. 5. Still on the same line, click View, Properties to open the Properties

window for the Part control. 6. Set the following properties:

o PartType: Page o PagePartID: Customer Statistics FactBox o SubFormLink: No.=FIELD(No.)

This adds the Customer Statistics FactBox of the specific Customer as a part of the page.

7. Repeat steps 4 to 6 for Customer Details FactBox.

NOTE: Other PartTypes which include System and Chart can also be added to a page.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 38: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-38

8. Compile, save, and close the page. 9. Run the page and test the FactBoxes.

FIGURE 4.38 MY CUSTOMER CARD PAGE

Demonstration: Create a List Page The following demonstration shows how to create a List page.

Create a List Page

The following steps describe how to create a new List page from scratch.

1. Create a blank page of type List and attach the Customer table as the source table.

2. Set the following page properties: o Name: My Customer List o CardFormID: My Customer Card

3. Specify the ContentArea container and name it My Customer List. 4. Add a group control with a repeater subtype. 5. Add three field controls with SourceExpr No., Name, and Address.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 39: Na2009 enus devi_04

Chapter 4: Pages

4-39

6. Compile and save the page with the ID 90003, and the name My Customer List, and close the page.

FIGURE 4.39 MY CUSTOMER LIST PAGE

7. Run the page and test the repeater by double-clicking any of the

records.

Demonstration: Page and Part Page Pages can also display information from a table other than that page's source table. One way to do this is to display FactBoxes in the page. Another way is to display another page within the first page. This is known as a part and achieved by using a part control.

The following demonstration shows how to build two pages that are combined to show the customer records and the customer comments on one page.

Create a ListPart Page

The following steps show how to create the page that displays the comment lines for the customer. It is a ListPart page that fits into the part control on the My Customer Card form.

1. In the Object Designer's Page list, click the New button. The New Page window opens.

2. Create a ListPart page that contains the Date and Comment fields from the Comment Line table.

3. Set the AutoSplitKey property of the page to Yes.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 40: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-40

4. Compile and save the page with the ID 90004 and the name My Customer Subform, and close the page.

FIGURE 4.40 MY CUSTOMER SUBFORM PAGE

Modify the Main Page

The following steps show how to modify the main page to include the ListPart page as a Part.

1. Design page 90002, My Customer Card, from the Object Designer. 2. Add a part control under the last field of the General FastTab and

name it Comment Lines. Indent it to the same level as the General FastTab.

FIGURE 4.41 ADD THE LISTPART PAGE TO THE MY CUSTOMER CARD PAGE

NOTE: Press F3 to insert a new line in between existing controls.

3. Open the Properties window for the part control, and set the following property: o PartType: Page o PagePartID: My Customer Subform o SubFormLink: Table

Name=CONST(Customer),No.=FIELD(No.)

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 41: Na2009 enus devi_04

Chapter 4: Pages

4-41

4. Close the Properties window, and compile, save and close the page. 5. Run the page, and test the Part page. 6. Run page 90003, My Customer List and open My Customer Card

for any customer. Test the ListPart page in My Customer Card.

FIGURE 4.42 MY CUSTOMER CARD PAGE WITH A LISTPART PAGE

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 42: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-42

Lab 4.1 - Create a Card, a List and a ListPart Page The following lab tests the basic knowledge on how to create a Card page, and a List page and how to link both pages together.

Scenario

Simon is a developer working for CRONUS International Ltd. CRONUS International has decided to start selling Microsoft Dynamics NAV training courses as its business.

Simon has already created a Course table to record courses information. Now, Simon must create pages to interface the Course table so that his users can insert, edit and delete course records as needed, by using the Microsoft Dynamics NAV RoleTailored client.

Challenge Yourself!

1. Create a Card page for the Course table. 2. Create a List page for the Course table.

Need a Little Help?

Create a Card page.

1. Create a new Card page with the source table Course. 2. Add a ContentArea container. 3. Add a FastTab. 4. Add the following fields: Code, Name, Description, Duration,

Price, Type and Active. 5. Compile, save and close the page.

Create a List page.

1. Create a new List page with the source table Course. 2. Set the page properties. 3. Add a ContentArea container. 4. Add a repeater. 5. Add the following fields: Code, Name and Description. 6. Compile, save and close the page.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 43: Na2009 enus devi_04

Chapter 4: Pages

4-43

Step by Step

Create a Card page.

1. In the Object Designer's Page List, click the New button. 2. Type Course in the Table field, select Create blank page of type,

select Card, and then click OK. 3. Type the following on the first line to add the container control:

Caption Type SubType

Course Card Container ContentArea

4. Type the following on the next line to add the General FastTab:

Caption Type SubType General Group Group

5. Click View, Field Menu, select Code, Name, Description, Duration, Price, Type and Active, and then click the line under the General FastTab.

6. Click Yes for the confirmation message. 7. Compile and save the page with the ID 90010, and the name Course

Card, and close the page.

Create a List page.

1. In the Object Designer's Page List, click the New button. 2. Type Course in the Table field, select Create blank page of type,

select List, and then click OK. 3. Open the Properties window for the page and set the following

properties: o CardFormID: Course Card o Editable: No

4. Close the Properties window. 5. Type the following on the first line to add the container control:

Caption Type SubType

Course List Container ContentArea

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 44: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-44

6. Type the following on the next line to add the repeater:

Type SubType

Group Repeater

7. Click View, Field Menu, select Code, Name and Description, and then click the line under the repeater.

8. Click Yes for the confirmation message. 9. Compile and save the page with the ID 90011, and the name Course

List, and close the page.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 45: Na2009 enus devi_04

Chapter 4: Pages

4-45

Summary Pages provide a flexible foundation for building many types of display objects. Compared to the Classic client that has card forms and list forms, the RoleTailored client has equivalent page types and several new ones that help build pages with special layouts. Pages also contain new types of controls that enable advanced representation of system data and shortcuts to system features.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement

Page 46: Na2009 enus devi_04

C/SIDE Introduction in Microsoft Dynamics® NAV 2009

4-46

Quick Interaction: Lessons Learned Take a moment and write down three key points you have learned from this chapter

1.

2.

3.

Microsoft Official Training Materials for Microsoft Dynamics ® Your use of this content is subject to your current services agreement