In Dynamics 365 Business Central, actions are displayed at the top of each page, referred to as the action bar. In this topic, you learn about different types of actions, and how you can enable users to quickly locate the actions they want to use.
The actions can be displayed in different menus on the action bar.
You can choose from the following action menus to place the actions in the specified area.
||Role Center, list, card, and task pages||User tasks||Post a sales order|
|New document group in Actions menu||
||List, card, Role Center pages, and task pages||Actions that appear under the New group. Opens a new Dynamics 365 document.||New sales invoice|
||List, card, and task pages||Links to other pages in Dynamics 365 Business Central.||Prices|
||Role Center, list, card, and task pages||A list of available reports.||Customer Top 10 List|
The following Actions are related to the Role Center page.
||Role Center pages||The top-level navigation consists of one or more root items that expand to display a submenu of links to other pages.||Posted sales invoices|
||Role Center pages||The second-level navigation displays a flat list of links to other pages.||Customers|
For more information about actions used on the role center page, see Designing Role Centers.
If you used to work in Microsoft Dynamics NAV, you can get an overview of the mapping between actions in the Differences in the Development Environments topic.
Types of Actions
Each page has a different set of actions depending on the page type, and the processes that the page supports. In order to create the appropriate set of actions for a particular page, you should have a good understanding of your customer's business processes.
Each process in an organization has several actions associated with it. You should try to create a full set of actions that mirror all tasks and processes that are performed.
Example: The Sales Orders list page at CRONUS International contains all actions related to processing sales orders. During user configuration and personalization, some of these actions may be hidden or promoted to the ribbon. Therefore, you must create a full set of actions for the customer.
Pages can have the following actions as described in each section below.
The Actions menu is a displayed in the action bar on all page types, and contains relevant tasks for the current page. Typically, you add processing tasks and creation tasks in the Actions menu. To add processing actions such as posting a sale order, you must use the
processing action area. They are regular daily tasks. Therefore, they must be on the Actions menu. For examples on how to add actions to the Actions menu, see Adding Actions to a Page.
Some examples from the Customer page are as follows:
Sales Credit Memo
New Document menu
The New Document menu is often displayed both as a top-level menu in the actions bar and as a sub menu in the Actions menu. You can use this menu to open new documents within Dynamics 365. You can add an action to create a new document such as creating a new sales invoice. This action displays in a separate menu called New document in the Actions menu. To add to the New document menu, you must use the
creation action area.
Example: On the Customers page, if the order processor wants to create a new invoice, she can open the new page directly from the Actions menu. This is useful as she creates new sales invoices daily.
The Navigate menu is displayed after the Actions menu in the action bar. Rather than providing tasks for the user, this menu provides additional information by taking the user to a specific page in Dynamics 365. To add a page link in the Navigate menu, you must use the
navigation action area. These actions act like a bookmark to enable quick access to view a page.
You should not add a Navigation action to a Role Center page.
The Report menu is displayed after the Navigate menu in the action bar. The Reports menu lists the reports most relevant to a page. If a user does not require a Report menu, then the menu is hidden. Sometimes it is relevant to promote the most important reports to the top-level in the action bar to save the user from too many clicks. To create an action in the Report menu, you must use the
reporting action area.
Promoted actions are actions that are set up on the Actions, Navigate, or Reports menus in the action bar, but are also configured to display in custom menus in the action bar. Although the actions are set up on the Actions, Navigate, or Report menus, you can choose to hide them on these menus and only show them in custom menus . For more information on how to add promoted actions, promoted categories and example, see Promoted Actions.
Actions at runtime
An action can trigger code to run, such as posting a document or otherwise modifying a record in a table. When a user chooses an action, one of the following pieces of logic will happen in addition to the code that the action itself triggers:
If the page is empty and no longer shows any records, the page is re-initialized with default values.
If the page does show records, and the current state is within the page filters boundary, the OnAfterGetRecord trigger is executed on the page.
If the current record that the page showed is now outside the filter but there are other records within the filter, the OnFindRecord trigger is called and the OnAfterGetRecord trigger is run on the next record with the given filters.
The logic runs in the transaction that the action triggered. This can cause the application code to result in users locking the whole table when they thought they were only modifying one record.
To avoid users accidentally locking tables, you can use the SetSelectionFilter method before your code passes the record variable to the processing codeunit, for example. The following code example illustrates the code on the OnAction trigger on an action on a page.
if confirm('Are you sure you want to call this codeunit?', true) then begin CurrPage.SetSelectionFilter(Rec); codeunit.Run(50000, Rec); end;