Walkthrough: Creating a Role Center
In this walkthrough, you will learn how to create a new Role Center for the Microsoft Dynamics NAV Windows client or Microsoft Dynamics NAV Web client. In Microsoft Dynamics NAV 2015, a Role Center is a type of page on which you can place different parts. Each part is a container in which you can host other pages or predefined parts, such as an Outlook part or parts for adding tasks, notifications, or notes.
Important
Only system parts, card parts, and list parts are supported page types for the Role Center.
Important
While removing cues is possible when customizing the Role Center, activity items cannot be removed.
About This Walkthrough
This walkthrough illustrates the following tasks:
Creating a Role Center page.
Creating a CardPart page that displays a visual representation of work queues.
Adding actions to the CardPart page.
Adding the CardPart page to the Role Center page.
Adding the MyNotes system part to the Role Center page.
Prerequisites
To complete this walkthrough, you will need:
Microsoft Dynamics NAV 2015 installed with a developer license.
CRONUS International Ltd. demonstration database.
Story
Simon is a partner working for CRONUS International Ltd. Susan, the Order Processor at CRONUS, has contacted Simon and asked him to create her a new Role Center that will show her work queue, give her easy access to common actions like creating a new sales order, and will also display a list of current notifications.
Creating a Role Center Page
Simon creates a new Role Center using Page Designer. Simon knows that because Role Centers can contain several different parts, they are not tied to a specific source table. As a result, when Simon creates the Role Center page, he does not select a table in the New Page window.
To create a Role Center page
In the Microsoft Dynamics NAV Development Environment, on the Tools menu, choose Object Designer.
In Object Designer, choose Page, and then choose New. The New Page window opens.
Choose Create blank page, and then choose the OK button.
The new page opens in Page Designer.
On the first row, in the Name field, type RoleCenterContainer.
The Type column is preset to Container and the Subtype column is preset to ContentArea.Select a blank row, and on the View menu, choose Properties.
In the Properties window, in the PageType property, set the Value field to RoleCenter.
Close the Properties window.
On the File menu, choose Save. Set Name to Sales Order Proc. Role Center, and set ID to 50005. Choose the OK button.
Creating a Sales Order Processor Queue Page
Simon needs to create a page that provides a visual indicator of the work Susan has to do each day. He wants to host this page in a part on Susan's Role Center so he will need to create it before he can add it to the Role Center page that he just created. He has already created a table that contains the fields that he wants to use, so he only needs to create the page. Simon knows that to create a queue, he must use the CardPart page type.
To create a Sales Order Processor Queue page
In Object Designer, choose Page, and then choose New.
In the Table text box, choose the up button, select table 9053, Sales Cue, and then choose the OK button.
Choose Create blank page, and then choose OK.
The new page opens in Page Designer.
On the first row, in the Caption column, type SalesOrderContainer.
The Type column is preset to Container and the Subtype column is preset to ContentArea.Select a blank row, and on the View menu, choose Properties.
In the PageType property, set the Value field to CardPart.
Close the Properties window.
In the second row, in the Caption column, enter For Release, and then set Type to Group and SubType to CueGroup.
Choose the next empty line, and on the View menu, choose Field Menu.
The Field Menu window opens, displaying the list of available fields from the SalesCue table (Table 9053).
Select the following fields:
Sales Quotes - Open
Sales Orders - Open
Tip
You can select multiple fields by holding down the Ctrl key.
Choose the OK button.
A message box appears with the following message: "Do you want to add the fields that are selected in the field menu?"
Choose Yes.
On the next empty line, in the Caption column, enter Sales Orders Released Not Shipped, then set Type to Group and SubType to CueGroup.
Select the next empty line and, on the View menu, choose Field Menu.
Select the following fields:
Ready to Ship
Delayed
Partially Shipped
Choose OK and confirm the selection.
On the next empty line, in the Caption column, enter Returns, then set Type to Group and set SubType to CueGroup. Choose the left arrow to negative indent this line one level.
Select the next empty line and, on the View menu, choose Field Menu.
Select the following fields:
Sales Return Orders - All
Sales Credit Memos - All
Choose OK and confirm the selection.
On the File menu, choose Save, name your new page Sales Order Processor Queue and set the ID to 50006. Choose the OK button.
In Object Designer, select the page, and then choose Run.
The RoleTailored client opens and displays the new page.
Adding Actions to the Sales Order Queue Page
Simon now needs to add actions to the Sales Order Processor Queue page. He knows that the CardPart page type is special in that he can include actions on individual groups within the page. These actions will then be displayed immediately adjacent to the queues on the page. He also adds code to the OnOpenPage() method to ensure that the work queues update to reflect Susan's current work when the Role Center opens.
To add actions to the Sales Order Processor Queue page
In Object Designer, select page 50006, Sales Order Processor Queue, and choose Design.
In Page Designer, choose the For Release group line, and on the View menu, choose Control Actions.
The Action Designer opens.
In Action Designer, on the first row, in the Caption column, enter New Sales Quote, and set the Type column to Action.
With the first row selected, on the View menu, choose Properties.
Set the following properties.
Property Value RunPageMode
Create
Image
Quote
RunObject
Page Sales Quote
Close the Properties window.
In Action Designer, on the second row, in the Caption column, enter New Sales Order, and then set the Type column to Action.
With the second row selected, open the Properties window.
Set the following properties.
Property Value RunPageMode
Create
RunObject
Page Sales Order
Close the Properties window.
In Page Designer, choose the Sales Orders Released Not Shipped group line, and on the View menu, choose Control Actions.
In Action Designer, in the first row, in the Caption column, enter Navigate, and set the Type column to Action.
With the first row selected, open the Properties window.
Set the following properties.
Property Value Image
Navigate
RunObject
Page Navigate
Close the Properties window.
In Page Designer, choose the Returns group line, and on the View menu, choose Control Actions.
In Action Designer, on the first row, in the Caption column, enter New Sales Return Order, and set the Type column to Action.
With the first row selected, open the Properties window.
Set the following properties.
Property Value RunPageMode
Create
RunObject
Page Sales Return Order
Close the Properties window.
In Action Designer, in the second row in the Caption column, enter New Sales Credit Memo, and then set the Type column to Action.
With the second row selected, open the Properties window.
Set the following properties.
Property Value RunPageMode
Create
RunObject
Page Sales Credit Memo
Close the Properties window.
In Page Designer, select the first empty line, and on the View menu, choose C/AL code.
Enter the following code in the OnOpenPage() method:
RESET; IF NOT GET THEN BEGIN INIT; INSERT; END; SETRANGE("Date Filter",0D,WORKDATE - 1); SETFILTER("Date Filter2",'>=%1',WORKDATE);
Save the page.
Close the C/AL Editor and then close Page Designer.
In Object Designer, choose Run to view the page.
Adding Parts to the Role Center Page
Simon now needs to add his new sales order queue page to Susan's new Role Center. Simon knows that he can create multiple groups with multiple parts on the Role Center, but he will have to create one group that contains two parts, the Sales Order Processer Queue page and a notifications page.
To add parts to the Role Center page
In Object Designer, select page 50005, Sales Order Proc, Role Center, and choose Design.
On the first row, in the Name column, enter SalesOrderRoleCenterContainer, and set the SubType column to RoleCenterArea. This replaces the value in the field.
In the Name column in the second row, enter PartOneGroup, set Type to Group and then set SubType to Group.
In the Type column in the third row, set Type to Part.
On the View menu, choose Properties.
In the PagePartID property, set the Value column to 50006 Sales Order Processor Queue .
In the Page Designer for page 50005, in the fourth row, set the Type column to Part.
On the View menu, choose Properties.
Set the following properties.
Property Value PartType
System
SystemPartID
MyNotes
Close the Properties window.
Save the page.
In Object Designer, choose Run to view the page.
Next Steps
Simon's next steps are to add the My Customers and My Items parts to the page. For more information, see How to: Create a CardPart Page For Displaying Customer Data in a FactBox.
See Also
Tasks
How to: Create a Page
Touring the RoleTailored Client Pages
How to: Run a Page