Dynamics 365 Business Central: How to substitute a page for another page via AL
Page substitution in Dynamics 365 Business Central allows developers to redirect users to a different page when opening a standard page using AL code. The post explains techniques such as using the Error method in OnOpenPage trigger and, starting with BC26, extending the CardPageId property for list pages.

post Dynamics 365 Lab
"Microsoft has not prepared any standard events in advance. So we have to solve this problem in other ways."
Key points
- Unlike reports, pages lack standard substitution events, requiring custom solutions in OnOpenPage trigger
- Using Error(‘’) after Page.Run() prevents the original page from opening, allowing seamless redirection
- CurrPage.Close() in OnOpenPage does not work reliably and may display blank pages
- Business Central 2025 wave 1 (BC26) introduced CardPageId property extension for easier card page substitution
- For card and document pages in earlier versions, SetRecord and Run methods with Error() provide a workaround
Quotes
- “Microsoft has not prepared any standard events in advance. So we have to solve this problem in other ways.” (Explains why custom solutions are needed instead of relying on built-in page substitution events like those available for reports)
- “Using this method, we can allow users to jump to our customized page when they open the standard page.” (Summarizes the practical benefit of the Error method approach for seamless page redirection)
- “Starting with Business Central 2025 wave 1 (BC26), this is no longer a problem, as we can extend the CardPageId Property.” (Highlights that BC26 introduced native support for card page substitution, simplifying the solution)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- page 427 “Payment Methods”
- page 4 “Payment Terms”
- page 21 “Customer Card”
- page 22 “Customer List”
- page “ZY Customer Card”
Not found in BC28-30: page “ZY Customer Card”.
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- 🕐 Remember When Lists Could Sort By Any Key? 🔄 — possibly related: both name Page 22 “Customer List”
- All new goodies about AL Namespace in BC 2025 wave 2 — possibly related: both name Page 22 “Customer List”
- Business Central 2026 release wave 1 (BC28): Run AL objects and open record references using fully qualified names (Support for namespaces and fully qualified names) — possibly related: both name Page 4 “Payment Terms”
- Business Central v29: System Audit Fields Now Available in Analysis Mode — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: Can we edit data directly in FactBox? — possibly related: both name Page 427 “Payment Methods”
- Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs) — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: Do users really need permissions for Temporary Tables? (Permissions and temporary tables) — possibly related: both name Page 427 “Payment Methods”
- Dynamics 365 Business Central: How to change Due Date of posted documents — possibly related: both name Page 4 “Payment Terms”
- Dynamics 365 Business Central: How to get current Profile (Role) info (Profile ID, Display Name, Source, Role Center ID, etc.) via AL — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: How to hide/disable New, Edit (Edit List), and Delete actions on the page — possibly related: both name Page 427 “Payment Methods”
Heads up
- gotcha: “CurrPage.Close() method does not work in trigger OnOpenPage().” (about OnOpenPage)
- gotcha: “This will open the Payment Terms page first, then the Payment Methods page (Sometimes the page cannot be opened and displays blank page).”
- breaking: “Starting with Business Central 2025 wave 1 (BC26), this is no longer a problem, as we can extend the CardPageId Property.” (about other CardPageId Property, version BC26)
Context
- Features: Page substitution via AL, PageExtension with OnOpenPage trigger, CardPageId property, Page.Run method, Error method for page redirection, SetRecord method, Editable property control
- Versions: Business Central 2025 wave 1, BC26
Source: Dynamics 365 Lab - Yun Zhu, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.