---
id: post/yzhums-com/61818
type: post
title: "Dynamics 365 Business Central: How to substitute a page for another page via AL"
summary: 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.
tier: community
language: en
tags:
  - page customization
  - page extension
  - al development
  - user redirection
  - page substitution
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-26T06:42:23.084Z"
  flags: []
generated:
  at: "2026-10-26T05:51:10.938Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 6d699d27f315c23ba7d03afa43ea42ba6789718609c1fd40527117b90f008678
evidence:
  - kind: blog
    url: https://yzhums.com/61818/
    title: "Dynamics 365 Business Central: How to substitute a page for another page via AL"
    date: "2025-08-27"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://yzhums.com/61818/
    title: "Dynamics 365 Business Central: How to substitute a page for another page via AL"
    date: "2025-08-27"
    commit: null
    t: null
    quote: Microsoft has not prepared any standard events in advance. So we have to solve this problem in other ways.
  - kind: blog
    url: https://yzhums.com/61818/
    title: "Dynamics 365 Business Central: How to substitute a page for another page via AL"
    date: "2025-08-27"
    commit: null
    t: null
    quote: Using this method, we can allow users to jump to our customized page when they open the standard page.
  - kind: blog
    url: https://yzhums.com/61818/
    title: "Dynamics 365 Business Central: How to substitute a page for another page via AL"
    date: "2025-08-27"
    commit: null
    t: null
    quote: Starting with Business Central 2025 wave 1 (BC26), this is no longer a problem, as we can extend the CardPageId Property.
links:
  learn: []
  objects:
    - object/page/427
    - object/page/4
    - object/page/21
    - object/page/22
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  related:
    - to: post/gerardorenteria-blog/12961
      title: 🕐 Remember When Lists Could Sort By Any Key? 🔄
      label: possibly related
      why: both name Page 22 "Customer List"
      by: code
    - to: video/KmuTVkodRXM
      title: All new goodies about AL Namespace in BC 2025 wave 2
      label: possibly related
      why: both name Page 22 "Customer List"
      by: code
    - to: post/yzhums-com/71262
      title: "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)"
      label: possibly related
      why: both name Page 4 "Payment Terms"
      by: code
    - to: video/H7R_m8Ue38g
      title: "Business Central v29: System Audit Fields Now Available in Analysis Mode"
      label: possibly related
      why: both name Page 22 "Customer List"
      by: code
    - to: post/yzhums-com/66037
      title: "Dynamics 365 Business Central: Can we edit data directly in FactBox?"
      label: possibly related
      why: both name Page 427 "Payment Methods"
      by: code
    - to: post/yzhums-com/63595
      title: "Dynamics 365 Business Central: Convert Word (.docx) To PDF (.pdf) within BC (No control add-in and APIs)"
      label: possibly related
      why: both name Page 22 "Customer List"
      by: code
    - to: post/yzhums-com/22035
      title: "Dynamics 365 Business Central: Do users really need permissions for Temporary Tables? (Permissions and temporary tables)"
      label: possibly related
      why: both name Page 427 "Payment Methods"
      by: code
    - to: post/yzhums-com/63315
      title: "Dynamics 365 Business Central: How to change Due Date of posted documents"
      label: possibly related
      why: both name Page 4 "Payment Terms"
      by: code
    - to: post/yzhums-com/68731
      title: "Dynamics 365 Business Central: How to get current Profile (Role) info (Profile ID, Display Name, Source, Role Center ID, etc.) via AL"
      label: possibly related
      why: both name Page 22 "Customer List"
      by: code
    - to: post/yzhums-com/56521
      title: "Dynamics 365 Business Central: How to hide/disable New, Edit (Edit List), and Delete actions on the page"
      label: possibly related
      why: both name Page 427 "Payment Methods"
      by: code
post_id: "61818"
source_id: yzhums-com
source_name: Dynamics 365 Lab - Yun Zhu
url: https://yzhums.com/61818/
published_at: "2025-08-27T00:50:05.000Z"
author: Yun Zhu
full_text: false
words: 638
quotes:
  - text: Microsoft has not prepared any standard events in advance. So we have to solve this problem in other ways.
    why_it_matters: Explains why custom solutions are needed instead of relying on built-in page substitution events like those available for reports
  - text: Using this method, we can allow users to jump to our customized page when they open the standard page.
    why_it_matters: Summarizes the practical benefit of the Error method approach for seamless page redirection
  - text: Starting with Business Central 2025 wave 1 (BC26), this is no longer a problem, as we can extend the CardPageId Property.
    why_it_matters: Highlights that BC26 introduced native support for card page substitution, simplifying the solution
code_objects_mentioned:
  - page Payment Methods
  - page Payment Terms
  - page Customer Card
  - page Customer List
  - page ZY Customer Card
systems:
  - development
  - platform
versions_mentioned:
  - Business Central 2025 wave 1
  - BC26
cautions:
  - kind: gotcha
    quote: CurrPage.Close() method does not work in trigger OnOpenPage().
    objects: []
    events:
      - OnOpenPage
    versions: []
  - kind: gotcha
    quote: This will open the Payment Terms page first, then the Payment Methods page (Sometimes the page cannot be opened and displays blank page).
    objects: []
    events: []
    versions: []
  - kind: breaking
    quote: Starting with Business Central 2025 wave 1 (BC26), this is no longer a problem, as we can extend the CardPageId Property.
    objects:
      - type: other
        name: CardPageId Property
    events: []
    versions:
      - BC26
preview:
  embeddable: true
  frame_url: null
  image: https://yzhums.com/wp-content/uploads/2025/08/Snipaste_2025-08-27_09-42-25.png
  image_alt: null
  image_w: null
  image_h: null
  site_name: Dynamics 365 Lab
  favicon: https://yzhums.com/wp-content/uploads/2020/08/cropped-logo-3-32x32.png
  probed_at: "2026-10-26T06:16:08.895Z"
---

# Dynamics 365 Business Central: How to substitute a page for another page via AL

[Read the post](https://yzhums.com/61818/) · Dynamics 365 Lab - Yun Zhu (Yun Zhu, MVP) · 2025-08-27 · 638 words · tier community · reviewed (checked by Opus)

> 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.

## 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"](../../objects/page/427.md)
- [page 4 "Payment Terms"](../../objects/page/4.md)
- [page 21 "Customer Card"](../../objects/page/21.md)
- [page 22 "Customer List"](../../objects/page/22.md)
- 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? 🔄](../../posts/gerardorenteria-blog/12961.md) — possibly related: both name Page 22 "Customer List"
- [All new goodies about AL Namespace in BC 2025 wave 2](../../videos/KmuTVkodRXM.md) — 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)](../../posts/yzhums-com/71262.md) — possibly related: both name Page 4 "Payment Terms"
- [Business Central v29: System Audit Fields Now Available in Analysis Mode](../../videos/H7R_m8Ue38g.md) — possibly related: both name Page 22 "Customer List"
- [Dynamics 365 Business Central: Can we edit data directly in FactBox?](../../posts/yzhums-com/66037.md) — 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)](../../posts/yzhums-com/63595.md) — possibly related: both name Page 22 "Customer List"
- [Dynamics 365 Business Central: Do users really need permissions for Temporary Tables? (Permissions and temporary tables)](../../posts/yzhums-com/22035.md) — possibly related: both name Page 427 "Payment Methods"
- [Dynamics 365 Business Central: How to change Due Date of posted documents](../../posts/yzhums-com/63315.md) — 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](../../posts/yzhums-com/68731.md) — 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](../../posts/yzhums-com/56521.md) — 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.
