How to export all fields/controls in all pages in Dynamics 365 Business Central (Page Control Field)

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.
For example,
All fields/controls in page 22 “Customer List”:

We have previously discussed how to export all fields in all tables in Dynamics 365 Business Central. And how to view the all object details (Type, ID, Name…) and find out what extension an object belong to without using VS Code.

In this post, I would like to talk about a similar topic, how to export all fields/controls in all pages in Dynamics 365 Business Central (Page Control Field).

First of all this is not very difficult, but it requires some developer help.

This time we need to use table 2000000192 “Page Control Field”.

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 Control Field: Read.

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

Source Code:

page 50100 "ZY Page Control Fields"
{
    ApplicationArea = All;
    Caption = 'Page Control Fields';
    PageType = List;
    SourceTable = "Page Control Field";
    UsageCategory = Administration;

    layout
    {
        area(content)
        {
            repeater(General)
            {
                field(PageNo; Rec.PageNo)
                {
                    ToolTip = 'Specifies the value of the PageNo field.';
                }
                field(ControlId; Rec.ControlId)
                {
                    ToolTip = 'Specifies the value of the ControlId field.';
                }
                field(ControlName; Rec.ControlName)
                {
                    ToolTip = 'Specifies the value of the ControlName field.';
                }
                field(TableNo; Rec.TableNo)
                {
                    ToolTip = 'Specifies the value of the TableNo field.';
                }
                field(FieldNo; Rec.FieldNo)
                {
                    ToolTip = 'Specifies the value of the FieldNo field.';
                }
                field(Enabled; Rec.Enabled)
                {
                    ToolTip = 'Specifies the value of the Enabled field.';
                }
                field(Editable; Rec.Editable)
                {
                    ToolTip = 'Specifies the value of the Editable field.';
                }
                field(Visible; Rec.Visible)
                {
                    ToolTip = 'Specifies the value of the Visible field.';
                }
                field(SourceExpression; Rec.SourceExpression)
                {
                    ToolTip = 'Specifies the value of the Source Expression field.';
                }
                field(OptionString; Rec.OptionString)
                {
                    ToolTip = 'Specifies the value of the Option String field.';
                }
                field(Sequence; Rec.Sequence)
                {
                    ToolTip = 'Specifies the value of the Sequence field.';
                }
                field(SystemCreatedAt; Rec.SystemCreatedAt)
                {
                    ToolTip = 'Specifies the value of the SystemCreatedAt field.';
                }
                field(SystemCreatedBy; Rec.SystemCreatedBy)
                {
                    ToolTip = 'Specifies the value of the SystemCreatedBy field.';
                }
                field(SystemId; Rec.SystemId)
                {
                    ToolTip = 'Specifies the value of the SystemId field.';
                }
                field(SystemModifiedAt; Rec.SystemModifiedAt)
                {
                    ToolTip = 'Specifies the value of the SystemModifiedAt field.';
                }
                field(SystemModifiedBy; Rec.SystemModifiedBy)
                {
                    ToolTip = 'Specifies the value of the SystemModifiedBy field.';
                }
            }
        }
    }
}

Page Control Fields page:

Let’s do a simple test.

Filter Page No. to 22 (Customer List), then sort by Sequence.

You can find the fields and the order, which are the same as defined in 22 Page “Customer List”.

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

For the fields in the page, please refer to the table below.

PageNoControlIdControlNameTableNoFieldNoEnabledEditableVisibleSource ExpressionOption StringSequenceCreated AtCreated BySystem IDModified AtModified By
221295001522No.181trueTruetrueNo.0{00000000-0000-0000-0000-000000000000}{00000000-0000-0000-0000-000000000000}{00000000-0000-0000-0000-000000000000}
221330459806Name182trueTruetrueName1{00000000-0000-0000-0000-000000000000}{00000000-0000-0000-0000-000000000000}{00000000-0000-0000-0000-000000000000}

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

PS:
1. There is a similar page in the standard code (base app), page 9620 “Page Fields”.

We can open it using the URL.

And then we can use Page ID and Status to filter the fields on the page.

But please note that this page is not suitable for exporting all page fields, because it will display all fields in the table.

2. Although table 2000000192 “Page Control Field” cannot be opened directly on the page, it can be declared as a variable in our code.

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

END

Hope this will help.

Thanks for reading.

ZHU

コメント

Copied title and URL