Hi, Readers.
Today I would like to briefly share a mini tip I just saw on X (formerly Twitter), is there an easy way to check if a standard/base object has been extended?
More details: Mr. Bojan L. has given the answer.š
Extensions are a programming model where functionality is defined as an addition to existing objects and defines how theyāre different or modify the behavior of the solution. In addition to first-party extensions, there may also be third-party extensions in the environment, including AppSource Extensions or PTE.
![](https://yzhums.com/wp-content/uploads/2024/04/image-368-1024x576.png)
Therefore, sometimes it is important to determine whether the function currently being used is a standard function and whether it has been extended.
First, you can use the Page Inspection feature.
You start page inspection from the Help & Support page. Choose the question mark in the top right corner, choose Help & Support, and then choose Inspect pages and data. Or, you can just use the keyboard shortcut Ctrl+Alt+F1. More details: Inspecting pages in Business Central
TheĀ ExtensionsĀ tab displays installed extensions that affect the selected page or its source table.
There are four different extension types:
- Adds pageĀ indicates that the extension adds the page object.
- Extends pageĀ indicates that the extension modifies the page, like adding a field, action, or code. In AL, these modifications are done by a page extension object.
- Adds tableĀ indicates that the extension adds the table object.
- Extends tableĀ indicates that the extension modifies the source table, like adding a field or code. In AL, these modifications are specified by a table extension object.
![](https://yzhums.com/wp-content/uploads/2024/04/image-369-1024x576.png)
More details: What Page Inspection Shows
But this method has some limitations, for example, it can only be used on pages, and is not works for reports.
![](https://yzhums.com/wp-content/uploads/2024/04/image-370-1024x576.png)
And we cannot export the list. So we need another way.
PS: Extension objects overview
Object type | Description |
---|---|
Table extension | Add fields to an existing table. |
Page extension | Add fields, actions, and layout to an existing page. |
Report extension | Add data items, columns, request pages, and layouts to an existing report. |
Enum extension | Add new values to an existing enumeration. |
Permission set extension | Add new permissions to an existing permission set. |
We mentioned this method when discussing Dynamics 365 Business Central: View the all object details (Type, ID, Nameā¦) and find out what extension an object belong to without using VS Code, but the purpose is different.
page 9174 āAll Objects with Captionā:
![](https://yzhums.com/wp-content/uploads/2024/04/image-371.png)
![](https://yzhums.com/wp-content/uploads/2024/04/image-374.png)
You can force Business Central to run theĀ āAll Objects with CaptionāĀ page by adding theĀ ?page=9174Ā parameter to the URL, such as in the following example:Ā
https://businesscentral.dynamics.com/d8f36038-1f93-4543-affc-5dc92b6ee871/Sandbox?page=9174
![](https://yzhums.com/wp-content/uploads/2024/04/image-372-1024x101.png)
Or open it from Tell me.
![](https://yzhums.com/wp-content/uploads/2024/04/image-379-1024x377.png)
![](https://yzhums.com/wp-content/uploads/2024/04/image-373-1024x576.png)
When the Object Type is Extension objects, the id of the standard/base object will be displayed in the Object Subtype field. For example, ReportExtension
![](https://yzhums.com/wp-content/uploads/2024/04/image-375-1024x353.png)
In the extension:
![](https://yzhums.com/wp-content/uploads/2024/04/image-377-1024x285.png)
![](https://yzhums.com/wp-content/uploads/2024/04/image-376.png)
Letās look at another example. Page Extensions that extend Customer Ledger Entries (25, List)
![](https://yzhums.com/wp-content/uploads/2024/04/image-378-1024x333.png)
Very simple. We can also make a small tool to display the original object name and type.
Object type | Extend Object type |
---|---|
Table extension | Table |
Page extension | Page |
Report extension | Report |
Enum extension | Enum |
Permission set extension | PermissionSet |
![](https://yzhums.com/wp-content/uploads/2024/04/image-382-721x1024.png)
Looks good.
![](https://yzhums.com/wp-content/uploads/2024/04/image-381-1024x576.png)
![](https://yzhums.com/wp-content/uploads/2024/04/image-380-1024x576.png)
![](https://yzhums.com/wp-content/uploads/2024/04/image-383-1024x306.png)
Give it a try!!!š
2. Dynamics 365 Business Central: Find out which extension the field belongs to
Source code: Github
pageextension 50122 AllObjectswithCaptionExt extends "All Objects with Caption"
{
layout
{
addafter("Object Subtype")
{
field(ExtendObjectType; ExtendObjectType)
{
ApplicationArea = All;
Caption = 'Extend Object Type';
}
field(ExtendObjectName; ExtendObjectName)
{
ApplicationArea = All;
Caption = 'Extend Object Name';
}
}
}
var
ExtendObjectType: Text[30];
ExtendObjectName: Text[30];
trigger OnAfterGetRecord()
begin
ExtendObjectType := '';
ExtendObjectName := '';
case Rec."Object Type" of
Rec."Object Type"::"TableExtension":
begin
ExtendObjectType := 'Table';
ExtendObjectName := GetObjectNameFromID(Rec."Object Type"::Table, Rec."Object Subtype")
end;
Rec."Object Type"::"PageExtension":
begin
ExtendObjectType := 'Page';
ExtendObjectName := GetObjectNameFromID(Rec."Object Type"::Page, Rec."Object Subtype")
end;
Rec."Object Type"::ReportExtension:
begin
ExtendObjectType := 'Report';
ExtendObjectName := GetObjectNameFromID(Rec."Object Type"::Report, Rec."Object Subtype")
end;
Rec."Object Type"::EnumExtension:
begin
ExtendObjectType := 'Enum';
ExtendObjectName := GetObjectNameFromID(Rec."Object Type"::Enum, Rec."Object Subtype")
end;
Rec."Object Type"::PermissionSetExtension:
begin
ExtendObjectType := 'PermissionSet';
ExtendObjectName := GetObjectNameFromID(Rec."Object Type"::PermissionSet, Rec."Object Subtype")
end;
end;
end;
local procedure GetObjectNameFromID("Object Type": option; "Object ID": Text[30]): Text[30]
var
AllObjWithCaption: Record AllObjWithCaption;
begin
if AllObjWithCaption.Get("Object Type", "Object ID") then
exit(AllObjWithCaption."Object Name");
end;
}
END
Hope this will help.
Thanks for reading.
ZHU
ć³ć”ć³ć