Walkthrough: Creating a Customer List in Page Designer
In this walkthrough, you will learn how to create a basic page that displays a list of customers. From a selection in the customer list, you will enable end users to access customer details from the customer card.
Pages are a new type of object in Microsoft Dynamics NAV 2009. They are used in the same way that forms are used in earlier versions. Unlike forms, pages can be displayed on multiple clients, including the RoleTailored client, which is a Windows client. This flexibility lets you display the same information in different clients. Pages cannot be viewed in the Classic client.
About this Walkthrough
This walkthrough provides an overview of how to create and run a simple list page in Microsoft Dynamics NAV 2009, and demonstrates how to:
Create a list page.
Associate an existing card page with selections in the list.
Add controls to the page to display specific fields from a table.
Save the page.
Run the page in the RoleTailored client.
The following prerequisites are required for this walkthrough:
- Microsoft Dynamics NAV 2009 installed with a developer license.
Simon is a partner working for CRONUS International Ltd. Kevin, the Sales Manager at CRONUS, has contacted Simon and asked him to create a customer list. Kevin would like Simon to be sure that the existing customer card displays when he double-clicks a customer in the list.
Creating a List Page
To create Kevin's customer list, Simon knows that he needs to create a list page. Simon also needs to ensure that the card for a specific customer will open when Kevin double-clicks a customer in the list.
In this walkthrough, to learn about the properties and controls of a list page, you will create a list 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 list page that sets up many properties and controls for you. For more information about the wizard, see How to: Create a Page.
To create a List 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 Customer table, 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 CustomerListContainer.
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 List.
In Page Designer, from the View menu, click Properties.
The Properties window opens.
Locate the CardFormID property and click the AssistButton in the value field.
The Page List window opens.
Click page 21Customer Card and then click OK.
In Microsoft Dynamics NAV 2009, the CardFormID Property is used to associate an item in a list with a specific, existing card page. In this walkthrough, the Customer card page is associated with the Customer list page, enabling users to launch the customer card when they double-click a customer from the list.
Close the Properties dialog box.
Adding Customer Information to the Page
Now that Simon has created a basic list page, he wants to add a control and the appropriate fields so that the page will display the number, name, address, city, and phone number for each customer in the list.
To add controls to the page
In Page Designer, click the Name column in the second row and type CustomerListGroup. Set Type to Group and set SubType to Repeater.
The CustomerListGroup is indented one level below the CustomerListContainer, indicating that it is a child of, and will be displayed within, the CustomerListContainer.
Select the third row.
On the View menu, click Field Menu.
The Field Menu window opens, displaying the list of available fields from the Customer table (Table 18).
Select multiple fields by holding down the CTRL key while you click the following rows:
Click in Page Designer.
A message box appears with the following message: "Do you want to add the fields that are selected in the field menu?".
The OK button in the Field Menu dialog box is disabled and the field changes can only be committed by clicking in Page Designer. This is expected behavior.
The customer list displays, as shown in the following screen shot
Saving and Running the Page
Now that Simon's page is complete, he wants to see how it looks. Eventually, he will add an action to another page so Kevin can access the page. But while he is still working on it, Simon can save the page and then quickly run it in the RoleTailored client using the following procedure.
To save and run the page
The Save As dialog box appears.
Under ID, enter 50000.
Under Name, enter Kevin's Customer List.
This name is displayed in the page's action pane.
To run the page, in Page Designer, select the page 5000 Kevin's Customer List, and then click Run.
The RoleTailored client opens and displays the new page.
Next, Simon needs to add actions to the customer list page. He looks at the customer list that he created earlier and decides that he wants to add a Sales Order action. When selected, this action will create a new sales order.