How to export all actions in all pages in Dynamics 365 Business Central (table 2000000143 “Page Action”)

Dynamics 365 Business Central

Hi, Readers.
In Dynamics 365 Business Central, pages are the main way to display and organize data. A page is defined in code as an object composed of controls, properties, actions, and triggers.

We have previously discussed how to export all fields/controls in all pages in Dynamics 365 Business Central (Page Control Field).

In this post, I would like to talk about a similar topic, how to export all actions in all pages.

Actions are displayed at the top of each page, referred to as the action bar. More details: Actions overview
For example,
Actions in page 22 “Customer List”:

In base application:

It’s not difficult this time, we will use table 2000000143 “Page Action”, but it requires some developer help.

All fields:

As you might know, we can add the table=<TableID> parameter to the client’s address (URL), replacing <TableID> with the ID of the table that we want to view. But please note that this table cannot be opened by this way.

Your license does not grant you the following permissions on TableData Page Action: Read.

Fortunately, we only need to create a list page to see the values inside the table.

Source Code:

page 50011 "ZY Page Actions"
{
    ApplicationArea = All;
    Caption = 'Page Actions';
    PageType = List;
    SourceTable = "Page Action";
    UsageCategory = Lists;

    layout
    {
        area(content)
        {
            repeater(General)
            {
                field("Page ID"; Rec."Page ID")
                {
                    ToolTip = 'Specifies the value of the Page ID field.';
                }
                field("Action Index"; Rec."Action Index")
                {
                    ToolTip = 'Specifies the value of the Action Index field.';
                }
                field("Action ID"; Rec."Action ID")
                {
                    ToolTip = 'Specifies the value of the Action ID field.';
                }
                field(Indentation; Rec.Indentation)
                {
                    ToolTip = 'Specifies the value of the Indentation field.';
                }
                field("Parent Action ID"; Rec."Parent Action ID")
                {
                    ToolTip = 'Specifies the value of the Parent Action ID field.';
                }
                field("Action Type"; Rec."Action Type")
                {
                    ToolTip = 'Specifies the value of the Action Type field.';
                }
                field("Action Subtype"; Rec."Action Subtype")
                {
                    ToolTip = 'Specifies the value of the Action Subtype field.';
                }
                field(Name; Rec.Name)
                {
                    ToolTip = 'Specifies the value of the Name field.';
                }
                field(Caption; Rec.Caption)
                {
                    ToolTip = 'Specifies the value of the Caption field.';
                }
                field(ToolTip1; Rec.ToolTip1)
                {
                    ToolTip = 'Specifies the value of the ToolTip1 field.';
                }
                field(ToolTip2; Rec.ToolTip2)
                {
                    ToolTip = 'Specifies the value of the ToolTip2 field.';
                }
                field(ToolTip3; Rec.ToolTip3)
                {
                    ToolTip = 'Specifies the value of the ToolTip3 field.';
                }
                field(ToolTip4; Rec.ToolTip4)
                {
                    ToolTip = 'Specifies the value of the ToolTip4 field.';
                }
                field(Promoted; Rec.Promoted)
                {
                    ToolTip = 'Specifies the value of the Promoted field.';
                }
                field(RunObjectType; Rec.RunObjectType)
                {
                    ToolTip = 'Specifies the value of the RunObjectType field.';
                }
                field(RunObjectID; Rec.RunObjectID)
                {
                    ToolTip = 'Specifies the value of the RunObjectID field.';
                }
                field(RunPageMode; Rec.RunPageMode)
                {
                    ToolTip = 'Specifies the value of the RunPageMode field.';
                }
                field(RunSourceTable; Rec.RunSourceTable)
                {
                    ToolTip = 'Specifies the value of the RunSourceTable field.';
                }
                field(ApplicationArea; Rec.ApplicationArea)
                {
                    ToolTip = 'Specifies the value of the ApplicationArea field.';
                }
            }
        }
    }
}

Page Actions page:

Let’s do a simple test.
Filter Page ID to 22 (Customer List)

You can find the actions and the order, which are the same as defined in 22 Page “Customer List”. (This table are sorted by Page ID and Action Index)

Then we can use the Open in Excel feature to easily export these data.

Very easy, isn’t it? Give it a try!!!😁

PS: Using this method you can also export some useful information as follows
ToolTip: If the length is exceeded it will be displayed in ToolTip2, ToolTi3, and ToolTi4

RunObjectType, RunObjectID, RunObjectID, RunSourceTable, and ApplicationArea.

You can get this information in your extension if needed.

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL