Header Ads Widget

Top Picks

6/recent/ticker-posts

Page Actions in Business Central

Multi-purpose Buttons

 Introduction

At the top of each page is the action bar, which is where Dynamics 365 Business Central displays actions. This article teaches you about the many types of actions and how to create it so that users can quickly identify the activities they require.




Using the Dynamics 365 web client, you can create new actions, add them to a page, and preview them. On Business Central pages, the Dynamics 365 action bar has the following action options.

  • Promoted action categories
  • Actions
  • Navigate
  • Report




Action Menu

Every page type has an Actions menu with tasks that are appropriate for the present page. Processing and creative activities are frequently seen in action menus. You may add processing activities, such publishing a sales order, in the processing action box. They're regular daily tasks. The Actions menu must therefore contain them. See Adding Actions to a Page for examples of how to add actions to the Actions menu.


Code
page 50102 "Actions Demo"
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Documents;


    layout
    {
        area(Content)
        {

            group(Input)

            {
                Caption = 'Input';
                field(Initialamount; Initialamount)
                {
                    ApplicationArea = All;
                    ToolTip = 'Initial Amount';
                    Caption = 'Initial Amount';

                }
                field(NoOfYears; NoOfYears)
                {
                    ApplicationArea = All;

                }
                field(RateOfInterest; RateOfInterest)
                {
                    ApplicationArea = All;

                }
            }

            group(Output)

            {
                Caption = 'Output';
                field(FinalAmount; FinalAmount)
                {
                    ApplicationArea = All;
                    Editable = false;

                }
            }
        }
    }

    actions
    {
        area(Processing)
        {
            action("Calculate Simple Interest")
            {
                ApplicationArea = All;
                Caption = 'Calculate the Interest';
                Image = ExecuteBatch;
                ToolTip = 'Interest Calculation';
                trigger OnAction()
                begin
                    FinalAmount := Initialamount * (1 + RateOfInterest * NoOfYears);
                    Message('%1', FinalAmount);
                end;

            }
        }
        
    }

    var
        Initialamount: Decimal;
        NoOfYears: Integer;
        RateOfInterest: Decimal;

        FinalAmount: Decimal;
}

Here are a few screenshots from the Customer page:

  • Sales Invoice

  • Sales Quote

  • Sales Credit Memo

New Document Menu

In the actions bar and the Actions menu, the New Document option is frequently shown as both a top-level menu and a submenu. New Dynamics 365 documents can be launched by using this option. By including an action, such as creating a new sales invoice, a new document can be produced. The New document menu for this action is located in its own section of the Actions menu. You must use the creation action area to add to the New document menu.


Code

        area(Navigation)
        {
       
        area(Creation)
        {
            action("New Customer")
            {
                ApplicationArea = All;
                RunObject = page "Customer Card";
                Image = Post;

            }
        }

    

Navigate Menu


The Navigate menu follows the Actions menu in the action bar. This menu provides the user with access to more information by pointing them to a specific Dynamics 365 page rather than assigning them tasks to do. YIn order to add a page link to the Navigate menu, you must utilise the navigation action section. These actions serve as a quick bookmark to enable page viewing.


Code
area(Navigation)
{
action("Customer")
{
ApplicationArea = All;
AboutText = 'The customer Card view';
Caption = 'Customer Details';
RunObject = page "Customer Card";
}
action("Sales")
{
ApplicationArea = All;
Caption = 'Sales Details';
RunObject = page for the "Sales Analysis View Card";
}
}

Report Menu


In the action bar, the Report menu appears after the Navigate menu. The reports most pertinent to a page are listed in the Reports menu. A user's Report menu is hidden if they don't need it. In order to prevent the user from making too many clicks, it is often vital to move the most crucial reports to the top level of the action bar. You must use the reporting action section to build an action for the Report menu.

Code

area(Reporting)
{
group(TopNCustomer)
{
Caption = 'Top N Customer';
action("Top N customer")
{
ApplicationArea = All;
RunObject = report TopNCustomers;
}
}
}

The complete Code is available here



Thank you.

Leave your queries 😊

Post a Comment

0 Comments

Youtube Channel Image
goms tech talks Subscribe To watch more Tech Tutorials
Subscribe