10.1 Profile Objects & Custom Page Views in AL
Key Takeaways
- AL profile objects define role-tailored workspaces by binding a Role Center page, default page customizations, and metadata settings like Promoted and Enabled.
- The Customizations property associates pagecustomization objects with a profile, applying declarative layout modifications strictly to users operating within that profile.
- A pagecustomization object is strictly declarative, allowing control reordering and property modifications, but strictly prohibiting AL variables, procedures, triggers, event subscribers, or adding new fields.
- The views section in pageextension objects adds predefined filtered views to list pages, supporting Filters, OrderBy, and SharedLayout properties.
- Setting SharedLayout = false decouples a page view's layout from the base list page, allowing an independent layout block to show, hide, reorder, or freeze columns specifically for that view tab.
10.1 Profile Objects & Custom Page Views in AL
In Microsoft Dynamics 365 Business Central, user experience is fundamentally role-driven. Rather than presenting a monolithic, one-size-fits-all interface to every employee, the platform tailors pages, navigation menus, action bars, cues, and data filters to specific job functions. For the MB-820 certification exam, developers must master the declarative AL constructs that drive this role-tailored experience: the profile object, associated pagecustomization objects, profileextension objects, and Page Views (views) declared in page extensions.
1. Profile Objects (profile) in AL
A profile object in AL defines an individual role workspace in Business Central. Profiles represent job titles or organizational roles—such as Order Processor, Business Manager, Warehouse Worker, or an ISV-specific role such as Quality Assurance Inspector. When a user selects a profile in My Settings (or when an administrator assigns a default profile to a user or user group), Business Central configures their home Role Center page and applies all declarative UI layout customizations tied to that profile.
Profile Syntax and Core Properties
profile "Loyalty Manager"
{
Caption = 'Loyalty Program Manager';
ProfileDescription = 'Provides access to loyalty member accounts, point ledgers, reward tiers, and promotional campaigns.';
RoleCenter = page "Loyalty Manager Role Center";
Customizations = "Loyalty Customer Card Customization", "Loyalty Sales Order Customization";
Promoted = true;
Enabled = true;
}
Profile Object Properties Breakdown
| Property | Type | Description & Runtime Behavior |
|---|---|---|
Caption | Text / Label | The user-facing display name of the profile displayed in the My Settings page and the Role Explorer. Can be localized using .xlf translation files. |
ProfileDescription | Text | A detailed explanation of the role's responsibilities and workflows. Visible to administrators when managing profiles in the Web Client. |
RoleCenter | Page Identifier | Specifies the Page ID of type RoleCenter (e.g., page "Order Processor Role Center") that serves as the root home page when the user operates under this profile. |
Customizations | Comma-delimited list | Specifies the names of one or more pagecustomization objects defined in AL that automatically apply to pages when the profile is active. |
Promoted | Boolean | When set to true, the profile is featured prominently in the Role Explorer and highlighted in the top section of the profile selection dialog. Defaults to false. |
Enabled | Boolean | Controls whether the profile is selectable by end users. When set to false, the profile cannot be assigned or chosen in My Settings, though administrators can still inspect it. Defaults to true. |
Extending Existing Profiles with profileextension
Developers frequently need to enhance standard out-of-the-box profiles provided by Microsoft Base Application (such as "BUSINESS MANAGER" or "SALES ORDER PROCESSOR") by attaching custom page customizations without creating duplicate profiles. AL provides the profileextension object for this exact purpose:
profileextension "Loyalty Business Mgr Ext" extends "BUSINESS MANAGER"
{
Customizations = "Loyalty Customer Card Customization", "Loyalty Item Card Customization";
}
[!NOTE] A
profileextensionobject can only modify theCustomizationsproperty of an existing profile. It cannot reassign theRoleCenterpage or change theCaptionof base profiles.
2. Page Customization Objects (pagecustomization)
A pagecustomization object in AL defines declarative UI modifications for a specific existing page. Unlike a pageextension—which applies globally to all users across all profiles—a pagecustomization applies only when a user accesses that page while logged in under the profile that binds the customization in its Customizations property.
Page Customization Syntax & Structure
pagecustomization "Loyalty Customer Card Customization" customizes "Customer Card"
{
layout
{
// Hide non-essential financial fields for loyalty managers
modify("Credit Limit (LCY)")
{
Visible = false;
}
// Place loyalty-relevant fields prominently on the General FastTab
moveafter(Name; "Balance (LCY)")
// Rename group or alter group visual appearance
modify(General)
{
Caption = 'Customer & Loyalty Details';
}
}
actions
{
// Hide transactional posting actions irrelevant to loyalty administration
modify(Post)
{
Visible = false;
}
// Promote loyalty navigation actions
modify(CustomerLedgerEntries)
{
Visible = true;
}
}
}
Critical Restrictions on pagecustomization Objects
Understanding what a pagecustomization can and cannot do is one of the most heavily tested areas on the MB-820 certification exam:
- Strictly Declarative (No AL Code): You cannot declare global or local variables, custom procedures, triggers (such as
OnOpenPage,OnAfterGetRecord, orOnValidate), or event subscribers inside apagecustomizationobject. Doing so is a compilation error. - No Schema Expansion: You cannot add new fields, parts, or controls that do not already exist on the target page. To add a new database field or new action to a page, you must use a
pageextension. - Permitted Layout Operations: Modifications are limited to adjusting properties on existing controls (e.g.,
Visible,Caption,Importance,Enabled) and reordering existing controls usingmovefirst(),movebefore(),moveafter(), andmovelast(). - No Action Creation: You cannot declare new
action()blocks insidepagecustomization; you may onlymodify()ormoveexisting actions defined in the base page or page extensions.
3. Predefined Page Views in AL (views)
On list pages in Business Central, users frequently filter records to focus on specific operational subsets (for example, Open Sales Orders, Urgent Shipments, or Blocked Customers). In AL, developers can define permanent, out-of-the-box filtered views within a page or pageextension object using the views section.
Predefined views appear as persistent tabs at the top of the filter pane on the list page, allowing users to switch contexts with a single click.
pageextension 50110 "Sales Order List Views Ext" extends "Sales Order List"
{
views
{
addfirst
{
// View 1: Standard shared layout view
view(OpenHighValueOrders)
{
Caption = 'Open High-Value Orders';
Filters = where(Status = const(Open), "Amount Including VAT" = filter(> 50000));
OrderBy = descending("Order Date");
SharedLayout = true;
}
// View 2: Dedicated custom layout view
view(ExpeditedShippingOrders)
{
Caption = 'Expedited Shipments';
Filters = where("Shipment Method Code" = const('EXPRESS'), "Completely Shipped" = const(false));
OrderBy = ascending("Promised Delivery Date");
SharedLayout = false;
layout
{
modify("Shipment Method Code")
{
Visible = true;
}
modify("Promised Delivery Date")
{
Visible = true;
}
movefirst(Control1; "Promised Delivery Date")
}
}
}
}
}
Page View Properties Breakdown
Caption: The user-facing label rendered on the view tab in the Web Client filter pane.Filters: A staticwhere(...)clause defining record filtering criteria applied automatically when the view tab is selected. Supportsconst()literals,filter()expressions (e.g.,>50000,'A*|B*'), and multiple field conditions combined with commas (AND).OrderBy: Sets the default sorting key and direction (ascending(...)ordescending(...)).SharedLayout: A critical boolean property governing how UI layout changes behave across views:SharedLayout = true(Default): The view shares the column layout, column order, and column visibility of the default list page. If a user personalizes column widths or visible columns on the list, those layout changes apply across all shared views.SharedLayout = false: The view maintains an independent layout. Developers can define a dedicatedlayoutblock inside the view to show, hide, or reposition specific columns (e.g., placingPromised Delivery Datefirst) strictly when this specific view is active without altering the standard list layout.
4. UI Customization & Personalization Hierarchy
In Business Central, the user interface rendered in the browser is the result of a multi-layer composition pipeline. When multiple modifications target the same page element, Business Central resolves them in a deterministic order of precedence:
Base Page (AL)
└── + Page Extensions (AL - Global for all users)
└── + Predefined Views (AL - Tab-specific filters & layouts)
└── + Page Customizations (AL - Bound to active Profile)
└── + Admin Customizations (Web Client - Profile mode)
└── + User Personalizations (Web Client - Individual user)
Comparison: UI Modification Methods
| Dimension | Developer AL (views / pagecustomization) | Admin Customization (Profile Mode) | User Personalization (Web Client) |
|---|---|---|---|
| Defined By | Developer in Visual Studio Code via AL objects | Tenant Admin in Web Client via "Customize Pages" | Individual End User in Web Client via "Personalize" |
| Scope | Global (all tenants) or Profile-specific | Assigned Profile (all users with that role) | Individual user account only |
| Storage | Compiled extension package (.app) | Tenant database system tables | Tenant database user metadata tables |
| AL Code / Triggers | views in pageextension can trigger AL code; pagecustomization cannot | No AL code (declarative UI only) | No AL code (declarative UI only) |
| Maintenance | Version-controlled in Git repository | Exportable / Importable XML/JSON profiles | Managed in User Personalizations page |
| Extensibility | Can introduce new schema (via pageextension) | Cannot introduce new fields not in dataset | Cannot introduce new fields not in dataset |
Exam Traps & Best Practices
- Trap 1: Attempting code in
pagecustomization: If an exam question presents a scenario where business logic must execute when a specific role opens a page, the solution is NOT apagecustomization. The developer must use apageextensionwith conditional logic checking the active user's assigned profile (UserPersonalization.Get(UserSecurityId())). - Trap 2:
SharedLayoutdefaults: By default,SharedLayoutistrue. To give a view its own column order or visible fields,SharedLayout = falsemust be explicitly specified alongside an innerlayoutblock. - Trap 3: Profile Assignment: Setting
Enabled = falseon aprofileobject prevents users from selecting it in My Settings, but does not delete the profile definition from the database.
Which of the following modifications is permitted inside an AL pagecustomization object?
A developer creates a new predefined view in a page extension on the 'Customer Ledger Entries' page. The view must display columns in a different sequence than the standard list and expose several hidden fields. However, these layout changes must not affect the default list page or any other views. Which property configuration is required in the AL view definition?
In the Business Central UI composition hierarchy, an individual user uses the 'Personalize' action to hide a field on their Customer Card. Later, the tenant administrator customizes the profile for that user to make the same field visible and prominent. Which layout setting takes precedence when the user opens the Customer Card?
An AL developer needs to create a specialized role workspace for quality control inspectors. The workspace must use Page 50150 'QC Role Center', apply custom field arrangements to the Item Card, appear in the Role Explorer, and be immediately selectable by users in My Settings. Which AL object and property combination accomplishes this requirement?