Identifying Different Page Types
Earn 25 points (50 with Pro) in two steps
- ① Read through the lesson — each section gets a ✓ as you scroll through it.
- ② When every section has a ✓, tap Complete lesson.
0 of 11 read · keep scrolling
✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro
Lesson: Identifying Different Page Types in AL
Introduction: Why Page Types Matter in AL Development
When you are developing for Business Central using the AL (Application Language), the user interface is not just a collection of buttons and fields. It is a highly structured environment designed to guide users through business processes efficiently. The core of this user experience lies in the "Page" object. In AL, a page is the bridge between the underlying data stored in tables and the user who interacts with that data. If you choose the wrong page type for a specific task, you create friction, frustrate the user, and ultimately fail to deliver a functional business solution.
Understanding page types is fundamental because each type dictates how the data is presented, how the navigation flows, and what kind of actions the user can perform. For example, a card page is optimized for viewing a single record in detail, while a list page is built for scanning multiple records at once. If you try to force a complex document entry process into a standard list page, you will quickly find that the system lacks the necessary layout capabilities to support your requirements.
In this lesson, we will explore the different page types available in AL, analyze their intended use cases, and learn how to implement them effectively. By the end of this guide, you will be able to look at any business requirement and immediately identify the correct page type to satisfy it. This is the cornerstone of building professional, intuitive, and high-performing extensions for Business Central.
Not read yet
The Landscape of Page Types
In AL, the PageType property is the most critical setting when defining a new page object. This property tells the platform which template to use for rendering the interface. While there are many page types, they generally fall into a few functional categories: display of data (List, Card), document management (Document, Worksheet), and system or utility interfaces (RoleCenter, ConfirmationDialog, API).
1. List Pages
The List page is the most common type you will encounter. Its primary purpose is to display multiple records from a table in a grid or a list view. Users rely on list pages to filter, sort, and navigate through large datasets.
When designing a list page, you should focus on the columns that provide the most value for an overview. Users should be able to identify a record quickly without needing to open it.
Callout: List vs. ListPlus While both display data, a List page is strictly for tabular data representation. A ListPlus page, however, is a hybrid. It allows you to display a list alongside a card-like area, which is useful when you want to show a master-detail relationship on a single screen without requiring the user to navigate to a separate card page.
2. Card Pages
A Card page is designed to show the details of a single record. When a user clicks on an entry in a list, they are typically directed to a card page to edit that specific record. Card pages are organized into FastTabs, which allow you to group related fields together, keeping the interface clean and manageable.
3. Document Pages
Document pages are a specialized form of card pages. They are used for business transactions like Sales Orders, Purchase Invoices, or Service Orders. These pages are more complex because they usually involve a header (the main document information) and lines (the items or services being transacted). The structure of a document page is specifically tuned to handle the relationship between these two data components.
4. Worksheet Pages
Worksheet pages are designed for high-frequency data entry. Think of a General Journal or a Requisition Worksheet. These pages are optimized for speed, allowing users to quickly enter multiple lines of data without the overhead of opening individual records. They are often used for bulk processing or staging data before it is posted to the database.
Not read yet
Technical Implementation and Syntax
Defining a page type is straightforward in AL. You use the PageType property within the layout section of your page object. Here is the basic structure of a standard Card page:
page 50100 "Customer Card Extended"
{
PageType = Card;
SourceTable = Customer;
Caption = 'Customer Card';
layout
{
area(Content)
{
group(General)
{
field(Name; Rec.Name)
{
ApplicationArea = All;
}
field("No."; Rec."No.")
{
ApplicationArea = All;
}
}
}
}
}
Key Properties for Page Configuration
Beyond PageType, there are several other properties that influence how the page behaves:
- SourceTable: Defines the table that the page is bound to.
- Editable: A boolean property that determines if the user can modify the data.
- InsertAllowed / ModifyAllowed / DeleteAllowed: Fine-grained controls over the data manipulation capabilities of the page.
- CardPageID: Used on list pages to specify which card page should open when a user selects a record.
Tip: Property Inheritance Always set your
ApplicationAreaproperty at the page level or on individual fields. If you fail to set this, the page or field will not be visible to the user, leading to common "missing field" bugs.
Not read yet
Deep Dive: Specialized Page Types
As you advance, you will encounter scenarios that require specialized page types. These are not for general data entry but serve specific architectural needs.
RoleCenter Pages
The RoleCenter is the home page for a user. It is the entry point that dictates the user's primary workspace. It contains "Cues" (the big numbers that show pending tasks), "Activities," and navigation menus. You cannot simply create a standard page and call it a RoleCenter; it requires a specific structure that includes area(RoleCenter) and part definitions to host various cues and lists.
API Pages
API pages are used to expose Business Central data to external systems. Unlike standard UI pages, API pages do not have a visual interface for users. Instead, they provide a structured endpoint that can be queried via OData or REST calls. When you define an PageType = API, you must also define the APIPublisher, APIGroup, and APIVersion properties to ensure the endpoint is discoverable by external applications.
ConfirmationDialog
Sometimes you need to pause a process to ask the user a "Yes/No" question. The ConfirmationDialog is a transient page type used for this purpose. It does not store data; it simply captures a user's decision and passes it back to the code logic that triggered the dialog.
Not read yet
Comparison Table: Choosing the Right Type
| Page Type | Primary Use Case | User Interaction | Data Complexity |
|---|---|---|---|
| List | Browsing/Filtering records | High (Scanning) | Low (Table columns) |
| Card | Editing single records | High (Detail entry) | Medium (Fields/FastTabs) |
| Document | Transactional processing | High (Header/Lines) | High (Relational) |
| Worksheet | High-volume data entry | Very High (Keyboard) | Medium (Grid-based) |
| RoleCenter | Navigation/Dashboard | Low (Monitoring) | None (Aggregated) |
| API | Data integration | None (Machine-to-Machine) | N/A |
Best Practices for Page Development
1. Maintain Consistency
Users expect a consistent experience. If you are building a custom module, ensure your card pages follow the standard Business Central layout. Use standard FastTab names like "General," "Invoicing," and "Shipping" whenever possible. This reduces the learning curve for your end-users.
2. Keep it Lean
Avoid cluttering pages with too many fields. If a user has to scroll through fifty fields to find the one they need, your page design is failing. Use the Visible property or Group visibility to hide fields that are not relevant based on the current context or user role.
3. Use Actions Wisely
The action bar is where users perform tasks. Group your actions logically using actiongroup. Use the Promoted property to bring the most important actions to the forefront. If a user has to click four times to post an invoice, you haven't optimized the workflow.
Warning: Over-Promoting Actions Avoid the temptation to promote every action. If everything is promoted, nothing stands out. Only promote the actions that are essential for the primary business process the page supports.
4. Leverage the SourceTable Property
Always bind your pages to a SourceTable whenever possible. While "In-Memory" or "Temporary" tables are useful, they require significantly more code to manage data retrieval and saving. Utilizing the native data binding allows the platform to handle the heavy lifting of database transactions, validation, and locking.
Not read yet
Common Pitfalls and How to Avoid Them
Pitfall 1: Incorrect PageType for the Requirement
A common mistake is using a Card page to display a list of data. While it might technically work, it violates the UI guidelines of Business Central and provides a poor user experience.
- The Fix: Always map your requirement to the standard page patterns. If you need to show a collection, use a List. If you need to show one, use a Card. If you need to transact, use a Document.
Pitfall 2: Neglecting the ApplicationArea
If your page is not showing up in the search or the menu, the first place to check is the ApplicationArea property. If it is missing, the platform hides the object by default to prevent cluttering the interface for users who don't need that specific functionality.
- The Fix: Always set
ApplicationArea = All;during development. You can refine this later if you need to hide the page for specific license tiers.
Pitfall 3: Poorly Designed FastTabs
Placing all fields in a single, massive group makes a card page look unorganized.
- The Fix: Use FastTabs to categorize data. Grouping fields like "Address," "Communication," and "Posting" makes the page scannable and allows users to collapse sections they aren't currently using.
Pitfall 4: Ignoring the CardPageID
If you have a list page but haven't set the CardPageID, clicking on a record in the list will do nothing. This is a common source of confusion for testers.
- The Fix: Always define the
CardPageIDproperty on your List page to point to the corresponding Card page.
Not read yet
Step-by-Step: Creating a Document Page
Creating a document page is more involved than a simple card page because it requires two components: the header and the lines. Let’s walk through the creation of a hypothetical "Service Request" document.
- Define the Tables: First, ensure you have a
Service Headertable and aService Linetable. TheService Linetable should have aDocument No.field that acts as a foreign key to the header. - Create the Header Page: Create a new page object and set
PageType = Document. Bind it to yourService Headertable. - Add the Part: Inside the
layoutarea of your document page, add apart. This part will host theService Linelist page.layout { area(Content) { group(General) { ... } part(Lines; "Service Line List Part") { SubPageLink = "Document No." = field("No."); } } } - Define the SubPage: Create the
Service Linepage and setPageType = ListPart. This is a specialized page type that is intended to be embedded inside another page. - Test the Navigation: Open the document page. Ensure that when you change the record in the header, the lines in the subpage update automatically, thanks to the
SubPageLink.
Not read yet
Advanced Page Patterns: The "ListPlus" Pattern
The ListPlus page type is a powerful tool for master-detail views. It is essentially a page that displays a list on the left (or top) and a card on the right (or bottom). This is excellent for scenarios like a "Sales Order Processor" where the user wants to see a list of open orders and simultaneously view the details of the selected order without navigating away.
To implement this, you set PageType = ListPlus. Within the layout, you define a group for the list and a group for the card details. This pattern significantly reduces "click fatigue" for users who perform high-frequency data entry.
Callout: When to use ListPlus Use
ListPluswhen the user needs to compare multiple records while editing one, or when the overhead of navigating to a full card page would impede the speed of their workflow. It is a "power user" interface element.
Handling Data Entry with Worksheet Pages
Worksheet pages are arguably the most important pages for finance and logistics users. Because these pages are meant for high-speed input, you should prioritize the order of your fields. Place the most frequently used fields (like Date, Item No., and Quantity) at the beginning of the grid.
Avoid putting validation logic that triggers slow network calls on every OnValidate trigger if possible. While Business Central handles this well, an overly complex validation logic on a worksheet page can make the interface feel sluggish during rapid data entry.
Optimizing for Keyboard Entry
Users of worksheet pages often prefer to use their keyboard rather than the mouse. Ensure that your Tab order is logical. By default, the system follows the order of fields defined in the AL code. If you define your fields in a random order, the user's focus will jump around the screen, which is a major usability flaw.
Not read yet
Integrating with the Business Central Ecosystem
Your pages do not exist in a vacuum. They must integrate with the standard search functionality of Business Central. This is controlled by the UsageCategory and ApplicationArea properties.
If you want your page to be searchable in the "Tell Me" box, you must set the UsageCategory property:
- Administration: For setup pages.
- Documents: For transactional pages.
- Lists: For master data lists.
- Tasks: For daily operations or worksheets.
Example:
page 50101 "My Custom List"
{
PageType = List;
UsageCategory = Lists;
ApplicationArea = All;
// ...
}
If you omit UsageCategory, your page will be created in the system, but it will be invisible to users in the search bar. This is a common "why can't I find my page?" issue.
Summary of Key Concepts
- PageType is the Foundation: Every page must have a
PageTypedefined. This property sets the template and the behavioral expectations of the UI. - Context is King: A List page is for browsing; a Card page is for editing; a Document page is for transacting; a Worksheet is for high-speed input. Use the right tool for the job.
- Searchability: If you want users to find your page, you must define the
UsageCategoryandApplicationArea. Without these, your page is effectively hidden. - Subpages and Parts: Complex interfaces are built by nesting pages. Using
ListPartinside aDocumentpage is the standard way to handle header-line relationships. - Consistency Matters: Follow the standard UI guidelines of Business Central. Use FastTabs, standard action groups, and consistent field ordering to provide a professional experience.
- Performance: Be mindful of the logic inside your page triggers. Avoid heavy processing in
OnValidateorOnAfterGetRecord, as these run frequently and can impact the responsiveness of the interface. - Keyboard Navigation: For worksheet pages, always test the tab order. A smooth, predictable flow is essential for users who spend their entire day entering data.
Not read yet
FAQ: Common Questions
Q: Can I change the PageType of an existing page?
A: You can, but be careful. Changing the PageType will likely break the layout and the way data is rendered. It is usually better to create a new page if the requirements have changed significantly.
Q: What is the difference between a Card and a Document?
A: A Card is typically for master data (like a Customer or Item). A Document is for transactional data (like an Invoice) that consists of a header and lines.
Q: Why is my field not showing up on the page?
A: Check three things: 1) Is the ApplicationArea set? 2) Is the field visible in the layout? 3) Do you have the correct permissions to see the data?
Q: Can I have a page without a source table?
A: Yes, you can use a "Blank" or "Card" page with SourceTableTemporary = true or no source table at all for utility pages, but these are rare cases. Most pages in Business Central are tightly bound to a database table.
Q: How do I make a page look like a standard system page? A: Follow the Microsoft documentation on UI patterns. Avoid inventing your own layout styles. Using the standard "FastTab" and "Action Bar" patterns ensures your extension feels like a native part of the system.
Not read yet
Closing Thoughts
Mastering page types is not just about knowing the syntax; it is about understanding how users interact with data in a business environment. When you select the correct page type, you are not just writing code—you are designing a workflow. You are deciding how a user will scan a list, how they will input a complex order, and how they will navigate their daily tasks.
As you continue your development journey, keep these patterns in mind. Whenever you are tasked with building a new interface, pause and ask: "Is this a list of things to browse, or a single entity to edit?" The answer to that question will lead you to the right PageType every time. Practice building these different types in a test environment, experiment with the layout properties, and observe how the platform reacts. With time, these patterns will become second nature, allowing you to build sophisticated and highly usable extensions with confidence.
Not read yet
Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.
Spend your points to unlock exam-style practice questions
Spend points to unlock MB-820 exam-style practice questions.
Practice for MB-820