Skip to main content

Notifications

New way of Developing Promoted Action Categories in Business Central

Introduction: 

We know about the PromotedActionCategories and how Promoted action looks and feels in Business Central.
In this blog, I will explain the new action bar-related changes in Business Central AL Development and how to create new promoted action categories.


Pre-requisites: 

  • Basic Understanding of  Promoted Action Categories

Books & References: 

Demonstration: 

Currently, there are two ways to have Promoted Action Categories
Microsoft has introduced a new action area feature in Business Central which makes adding Promoted Actions easy on the Action bar.

Earlier, we used to create the Promoted Action Categories by defining them in Page Property and using the PromotedCategories in action. Refer link in References

This will be allowed but moving forward, we will need to use the new way.

1. Create Action:
You will create the actions as usual with the area as processing or creation
page 50100 Test
{
    PageType = Card;
    ApplicationArea = All;
    UsageCategory = Tasks;



    actions
    {
        area(Processing)
        {
            action("Message")
            {
                ApplicationArea = All;

                trigger OnAction();
                begin
                    Message('Hello World!');
                end;
            }
        action("Message 2")
            {
                ApplicationArea = All;

                trigger OnAction();
                begin
                    Message('Hello World 2!');
                end;
            }
        }
    }
}


2. Defined Promoted Action:
You can define the Promoted Action using the code below. 
        area(Promoted)
        {
            group(Test)
            {
                ShowAs = SplitButton;

                actionref(M1; "Message")
                {

                }

                actionref(M2; "Message 2")
                {

                }
            }

            group(Test2)
            {
                ShowAs = Standard;

                actionref(M3; "Message")
                {

                }

                actionref(M4; "Message 2")
                {

                }
            }
        }


Output:

As you can see we have two ways to showcase the actions
1. Using SplitButton


2. Using Standard

Conclusion:

I like the changes that Microsoft is making to action-promoted categories as it makes the developer's job more simpler and reduces confusion.

I hope this blog helps.

Cheers!!

This was originally posted here.

Comments

*This post is locked for comments