In this walkthrough, you will learn how to add a new Action menu item and then display that item as an icon on the Action Pane. The Action Pane is located at the top of most pages and is used to provide end users with easy access to common or important actions. Action menu items are referred to as actions. Actions that are displayed on the Action pane are referred to as promoted actions.
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:
-
Add an action to the customer list page to create a new sales order.
-
Display the Sales Order action on the Actions menu.
-
Promote the Sales Order action so it is displayed in the Action pane.
-
Modify the Sales Order action so it creates a new sales order for the customer currently selected in the customer list.
Prerequisites
This walkthrough builds on the steps described in Walkthrough: Creating a Customer List in Page Designer.
Story
Simon shows the customer list page that he created to Kevin, the Sales Manager at CRONUS International Ltd. who contracted him to create this page. Kevin likes how the customer list looks, but he would like Simon to add a menu item on the Actions menu to create a new sales order for the currently selected customer.
Adding an Action to the Customer List
Simon looks at the customer list that he created earlier and adds a new action to the page to create a sales order.
To add an action to the customer list page
-
In the Classic client, click Tools, and then click Object Designer.
-
In Object Designer, click Page, select page 50000 Kevin's Customer List, and then click Design.
The Kevin's Customer List page opens in Page Designer.
-
Select the first empty line on the page, which is located immediately below the <Phone No.> field.
-
With this line selected, on the View menu, click Actions.
Action Designer opens. For this walkthrough, Action Designer will be used to set actions on the page.
-
In Action Designer, click the Name column in the first row and type CustomerListActions.
The relevant ActionContainers for a list page are:
-
NewDocumentItems
-
ActionItems
-
RelatedInformation
-
Reports
-
HomeItems
-
ActivityButtons
For more information about the different types of actions, see Actions Overview.
-
-
Set the SubType to a value of ActionItems.
Actions with a SubType of ActionItems are displayed on the Action menu just above the Place section.
-
Click the Caption column in the second row and type Sales Order.
-
Set the Type to Action.
-
Click the third row and then click the second row. The remaining action columns are automatically filled in.
This action is indented one level below the ActionContainer to indicate that it is a child of (contained by) the ActionContainer.
-
Open the Properties window.
-
Set the RunObject property to Page Sales Order.
-
Save the page.
-
To run the page, in Page Designer, select the page 5000 Kevin's Customer List, and then click Run.
The Sales Order action now displays in the Actions menu.
Promoting an Action
When Simon opens the page, he realizes that he would like to promote the Sales Order action so that it displays on the Action pane in the New category. Promoted actions are displayed as icons within the Action pane located at the top of the page.
To promote an action
-
With the first empty line selected in Page Designer, open Action Designer.
-
Select the Sales Order action and view the Properties window.
-
Set the Image property to Document.
-
Set the Promoted property to Yes.
-
Set PromotedCategory property to New.
-
Set PromotedIsBig property to Yes.
-
Set the Caption property to S&ales Order.
The ampersand identifies the access key for this menu item. The access key is automatically set to the first letter in the caption by the client if another access key is not set using the ampersand.
-
Save the page.
-
Run the page.
The Sales Order command is now displayed in the Action Pane, as shown in the following screen shot.
Linking an Action with a Specific Item in a List
Simon verifies that the Sales Order action now displays in the Action pane. However, when he selects the Sales Order action, the Sales Order card opens and displays the first sales order in the database. Simon remembers that Kevin asked him to have the Sales Order action open a new sales order for the currently selected customer, instead. Simon opens the customer list page and starts making this change.
To add an action
-
In Action Designer, select the Sales Order action and view the Properties window.
-
Set the RunFormMode property to Create.
The default value for this property is Edit. By setting this property to a value of Create, a sales order page will open in create mode, enabling the end user to create a new sales order.
-
Set the RunFormLink property value to Sell-to Customer No.=FIELD(No.) using the following steps:
-
In the RunFormLink property value, click the Assist-Edit button (ellipsis).
The Table Filter window appears.
-
Click the AssistButton in the Field cell, click Sell-to Customer No., and then click OK.
-
Click the drop-down list box in the Type cell and then click FIELD.
-
Click the AssistButton in the Value cell, click No., and then click OK.
-
Click OK.
The customer number in the customer list is now linked to the Sell-to Customer number in the sales order. This means that when the Sales Order action is clicked, a new sales order will be created for the customer that is currently selected in the customer list.
-
-
Save the page.
-
Run the page.
To test the new functionality, select a customer from the list and then click the Sales Order action. A new sales order appears. Press the TAB key twice, or click any field on the page for customer information to populate the fields.
Next Steps
Next, Simon will add a FactBox to the customer list page. Simon will use this FactBox to display additional information about the currently selected customer in the list.
See Also
© 2010 Microsoft Corporation. All rights reserved.