← Back to TutorialsAL DEVELOPMENT

Page Extensions in Business Central — Complete Practical Guide

Dynexal • Intermediate Guide • 10 min read

Page extensions are one of the most useful AL development tools. They let you add fields, actions and other UI changes to an existing Business Central page without modifying the base application.

In this guide: pageextension syntax, adding fields, adding actions, choosing the right anchor, practical examples and common mistakes.

What is a page extension?

A pageextension object extends an existing page. For example, if the standard Customer Card already provides most of the functionality you need, you can add your own field or action through an extension.

Basic page extension syntax

pageextension 50100 MyCustomerCardExt extends "Customer Card"
{
    layout
    {
        addlast(General)
        {
            field("My Field"; Rec."No.")
            {
                ApplicationArea = All;
            }
        }
    }
}

The object ID must be unique in your extension. The page name after extends identifies the existing page you want to customize.

Adding a field

You can place a field into an existing page area by using layout modification keywords such as addfirst, addlast, addbefore and addafter.

layout
{
    addlast(General)
    {
        field("Customer No. Copy"; Rec."No.")
        {
            ApplicationArea = All;
            ToolTip = 'Shows the customer number.';
        }
    }
}
Tip: Prefer a clear ToolTip and place the field near related information. Good page extensions improve the user experience instead of simply adding more fields.

Adding an action

Actions let users run functionality directly from a page. A common pattern is to add an action and call a codeunit or page.

actions
{
    addlast(Processing)
    {
        action("My Action")
        {
            ApplicationArea = All;
            Caption = 'My Action';
            ToolTip = 'Runs a custom Business Central action.';

            trigger OnAction()
            begin
                Message('Dynexal action executed.');
            end;
        }
    }
}

Using a page extension in a real project

Imagine an e-commerce integration where you want to show an external order ID on the Sales Order page. The clean approach is to add the field through a table extension and then expose it through a page extension.

pageextension 50101 EcomSalesOrderExt extends "Sales Order"
{
    layout
    {
        addlast(General)
        {
            field("External Order ID"; Rec."External Order ID")
            {
                ApplicationArea = All;
                ToolTip = 'Shows the order ID from the external e-commerce system.';
            }
        }
    }
}

This separates the data model from the user interface: the table extension owns the field, while the page extension controls where users see it.

Common mistakes

Page extension vs. modifying the standard page

In modern Business Central development, extensions are the normal way to customize the application. Keeping your custom logic and UI changes in your own extension makes the solution easier to maintain and upgrade.

What should you learn next?

  1. Table extensions and fields.
  2. Page extensions and actions.
  3. Codeunits and events.
  4. Reports and RDLC layouts.
  5. APIs and external integrations.
  6. Testing, debugging and deployment.

For the fundamentals, review AL Tables in Business Central and Creating List and Card Pages in AL.

← Explore all Dynexal tutorials