Dynamics 365 Business Central: How to use Page.SetSelectionFilter Method in temporary records
Page.SetSelectionFilter marks user-selected records but doesn't work directly with temporary records without additional setup. The post demonstrates two approaches: manually transferring data from source records to temporary records, or using Record.Copy with the ShareTable parameter set to true when both records are temporary.

post Dynamics 365 Lab
"Page.SetSelectionFilter(var Record) is a very commonly used method, which can get the value currently selected by the user."
Key points
- Page.SetSelectionFilter notes user selections and filters to marked records only, but temporary records need data assigned beforehand
- For normal source tables, retrieve data using FindSet and TransferFields to populate temporary records before applying SetSelectionFilter
- For pages with temporary source tables, use Record.Copy with ShareTable set to true to reference the same table and apply SetSelectionFilter
- The ShareTable parameter in Record.Copy can only be true when both records are temporary
Quotes
- “Page.SetSelectionFilter(var Record) is a very commonly used method, which can get the value currently selected by the user.” (Establishes the core purpose of the method that developers need to understand)
- “If the variable is temporary, the value will not be obtained. Because we did not assign values to this temporary table in advance.” (Identifies the key problem that developers encounter when working with temporary records)
- “If FromRecord and Record are both temporary and ShareTable is true, then the COPY method causes Record to reference the same table as FromRecord.” (Explains the critical mechanism for handling temporary records with SetSelectionFilter)
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.
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 v29: System Audit Fields Now Available in Analysis Mode — possibly related: both name Page 22 “Customer List”
- 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: 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 22 “Customer List”
- Dynamics 365 Business Central: How to quickly get User Experience/Experience Tier (Essential or Premium) in AL — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: How to quickly identify the first transaction date and the number of days since the last sale with a customer — possibly related: both name Page 22 “Customer List”
- Dynamics 365 Business Central: How to substitute a page for another page via AL — possibly related: both name Page 22 “Customer List”
- Dynamics GP to Business Central – What does my migrated GP Historical Data look like in Business Central — possibly related: both name Page 22 “Customer List”
Heads up
- gotcha: “If the variable is temporary, the value will not be obtained.”
- warning: “Note that if the original table is not a temporary table, [Optional] ShareTable = true cannot be used.”
Context
- Features: Page.SetSelectionFilter method, Record.Copy method, Temporary records, Record selection, Filtering marked records, TransferFields
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.