Actions Overview

In Dynamics 365 Business Central, actions are displayed at the top of each page in the ribbon or in the navigation pane. 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 tabs on the action ribbon.

You can choose from the following action areas to place the actions in the specified area.

Area Syntax Used on Description Example
Actions menu area(processing) Role Center, list, card, and task pages User tasks Post a sales order
New document group in Actions menu area(creation) List, card, Role Center pages, and task pages Actions that appear under the New group. Opens a new Dynamics 365 document. New sales invoice
Navigate menu area(navigation) List, card, and task pages Links to other pages in Dynamics 365 Business Central. Prices
Report menu area(reporting) 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.

Area Syntax Used on Description Example
Navigation menus area(sections) 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
Navigation bar area(embedding) 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.

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.

Actions menu

Actions menu is a tab displayed in the ribbon 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 Invoice

  • Sales Quote

  • Sales Credit Memo

  • Ledger Entries

  • Invoice Discounts

  • Prices

  • Line Discounts

You can add actions to the Actions menu, group actions together under action submenus, or promote them to the ribbon. For examples of how to use actions, see Page Object and Page Extension Object.

New Document

The New Document action is often displayed both in the Home tab and in the Actions tab. You can use this action 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 seperate group called New document group in the Actions tab. To add to the New document group, 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 tab. This is useful as she creates new sales invoices daily.

The Navigate tab is displayed after the Actions menu in the ribbon. Rather than providing tasks for the user, this tab provides additional information by taking the user to a specific page in Dynamics 365. To add a page link in the Navigate tab, you must use the navigation action area. These actions act like a bookmark to enable quick access to view a page.

Note

You should not add a Navigation action to a Role Center page.

Report menu

The Report tab is displayed after the Navigate tab in the ribbon. The Reports tab lists the reports most relevant to a page. If a user does not require a Report tab, then the tab is hidden. Sometimes it is relevant to promote the most important reports to the Home tab to save the user from too many clicks. To create an action in the Report tab, you must use the reporting action area.

Promoted actions are actions that are set up on the Actions, Navigate, or Reports tabs in the ribbon, but are also configured to display on the Home tab. Although the actions are set up on the Actions, Navigate, or Report tabs, you can choose to hide them on these tabs and only show them on the Home tab. For more information on how to add promoted actions, promoted categories and example, see Promoted Actions.

Home menu

The Home tab is always displayed first so promoted actions provide quick access to common tasks, because users do not have to browse through a menu to access them. You can promote any command from the existing actions menus to the ribbon. If there are no promoted actions, the ribbon remains hidden. For more information, see Promoted Property.

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;         

See Also

AL Development Environment
Developing Extensions in AL
Pages Overview