Dynamics 365 Business Central V23: page actions and the Scope property

I think that every Dynamics 365 Business Central developer knows that you can add actions to a page object. Actions permits you to execute processes starting from the selected page or record (like opening new pages, related pages or executing custom code). But I see that few developers knows that actions can only have a scope.

With the Scope property of an action you can specify the scope of the action and that scope can be either page-specific, or specific to a repeater control.

The Scope property until Dynamics 365 Business Central 22.X had two possible options:

  • Page
  • Repeater

The Scope property is only used on pages that include a repeater control and it offers a way to determine the scope of an action to be the page or to be specific to the repeater control. The default behavior of the Scope property is Page.

The Scope property has the following effect:

  • On a Web client, if the Scope property is set to Page, the action will be shown in the ribbon. If the Scope property is set to Repeater the action will be shown in both the repeater control and in the ribbon.
  • On a tablet client, if the Scope property is set to Page, the action will be shown in the page action menu. If the Scope property is set to Repeater, the action is moved from the page action menu to the repeater control shortcut menu.
  • On a phone client, if the Scope property is set to Page, the action will be shown in the page action menu. If the Scope property is set to Repeater, there are two scenarios:
    • If the list is associated with a card page, the developer must make sure to add the action functionality to this card page.
    • If the list is not associated with a card page, and the user taps a row in the list to view details, the action is available on the details page.

Starting from Dynamics 365 Business Central 2023 Wave 2 release (version 23) the Scope property will have three new values:

  • RepeaterRowenables the action when exactly one row is selected.
  • RepeaterSelectionenables the action when one or more rows are selected. The action’s OnAction trigger will be invoked once for each row in the selection.
  • PageFilterenables the action whenever the page filter is a non-empty list. The action’s OnAction trigger will be invoked once for each row in the page filter, regardless of the user’s current selection.

With the RepeaterSelection or PageFilter scopes you can create multi-row actions.

When you’re creating a multi-row action, the OnAction trigger only has to deal with one record at a time by getting the current record using the Rec variable .

Please also remember that multi-row actions don’t support the following properties

  • RunObject
  • RunPageLink
  • RunPageMode
  • RunPageOnRec
  • RunPageView

Starting from Dynamics 365 Business Central 2023 Wave 2 release (version 23) pages will also a new property called AnalysisModeEnabled. This property (boolean) permits you to enable or disable the Analysis Mode view on the page directly from code:

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.