community postAL Developmentcommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: How to note the records that the user has selected on the Subpage/Lines (Page.SetSelectionFilter in part)

Page.SetSelectionFilter is a method that captures records selected by users on pages or subpages, marks them in the table, and applies a filter. The post explains how to use it both on main pages by accessing subpages via CurrPage and directly on subpage extensions.

post Dynamics 365 Lab

Yun Zhu · 2025-06-23 · 363 words · about 2 min

"CurrPage.SalesLines.Page.SetSelectionFilter(Salesline);"

Key points

  • Page.SetSelectionFilter(var Record) gets user-selected records and applies a ‘marked only’ filter
  • On main pages, access subpage selections using CurrPage.{SubpageName}.Page.SetSelectionFilter()
  • On subpage extensions, use CurrPage.SetSelectionFilter() directly like normal page usage
  • The method marks selected records in the specified table for processing

Quotes

  • “CurrPage.SalesLines.Page.SetSelectionFilter(Salesline);” (Shows the exact syntax for accessing selections on a subpage from the main page, a key practical technique)

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.

No source states these links: they share an object, a model read them, or a person found the same subject.

Context

  • Features: Page.SetSelectionFilter method, subpage selection handling, record filtering, marked records

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.