---
id: post/gerardorenteria-blog/12961
type: post
title: 🕐 Remember When Lists Could Sort By Any Key? 🔄
summary: A developer creates a solution to sort Business Central list pages by any predefined table key, not just single fields. The pattern uses temporary metadata storage, dynamic RecordRef reflection, and page extensions to offer flexible multi-field sorting that restores functionality from the NAV/C/SIDE era.
tier: community
language: en
tags:
  - sorting
  - list pages
  - table keys
  - multi-field sorting
  - page extensions
  - recordref
  - user interface
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T01:58:01.330Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-post: 1
  input_hash: 58de2341c95547e0f7ca68cd0793c99fd4ec7337ab5bc71af42cf5388c6ee4e8
evidence:
  - kind: blog
    url: https://gerardorenteria.blog/2025/12/01/%f0%9f%95%90-remember-when-lists-could-sort-by-any-key-%f0%9f%94%84/
    title: 🕐 Remember When Lists Could Sort By Any Key? 🔄
    date: "2025-12-01"
    commit: null
    t: null
    quote: null
  - kind: blog
    url: https://gerardorenteria.blog/2025/12/01/%f0%9f%95%90-remember-when-lists-could-sort-by-any-key-%f0%9f%94%84/
    title: 🕐 Remember When Lists Could Sort By Any Key? 🔄
    date: "2025-12-01"
    commit: null
    t: null
    quote: Every BC table has predefined keys designed for optimal data retrieval and sorting.
  - kind: blog
    url: https://gerardorenteria.blog/2025/12/01/%f0%9f%95%90-remember-when-lists-could-sort-by-any-key-%f0%9f%94%84/
    title: 🕐 Remember When Lists Could Sort By Any Key? 🔄
    date: "2025-12-01"
    commit: null
    t: null
    quote: After selecting the desired key, a new customer list window will open with the additional key title.
links:
  learn: []
  objects:
    - object/page/22
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
post_id: "12961"
source_id: gerardorenteria-blog
source_name: Gerardo Renteria
url: https://gerardorenteria.blog/2025/12/01/%f0%9f%95%90-remember-when-lists-could-sort-by-any-key-%f0%9f%94%84/
published_at: "2025-12-01T22:04:48.000Z"
author: Gerardo Renteria
full_text: false
words: 1180
quotes:
  - text: Every BC table has predefined keys designed for optimal data retrieval and sorting.
    why_it_matters: Explains why leveraging table keys instead of arbitrary field combinations makes sense for performance and intentional sorting patterns.
  - text: After selecting the desired key, a new customer list window will open with the additional key title.
    why_it_matters: Shows that the solution preserves the original view while opening a separate sorted view, allowing users to compare sort orders without losing context.
code_objects_mentioned:
  - table GDRG Table Key
  - codeunit GDRGKeyManager
  - page GDRG Key Selection
  - page Customer List
  - permissionset GDRGKeyManager
systems:
  - development
  - sales
versions_mentioned: []
preview:
  embeddable: true
  frame_url: https://gerardorenteria.blog/2025/12/01/%f0%9f%95%90-remember-when-lists-could-sort-by-any-key-%f0%9f%94%84/embed/
  image: https://i0.wp.com/gerardorenteria.blog/wp-content/uploads/2025/12/designer-1.png?fit=1200%2C800&ssl=1
  image_alt: null
  image_w: 1200
  image_h: 800
  site_name: Gerardo Rentería Blog
  favicon: https://gerardorenteria.blog/wp-content/uploads/2020/11/cropped-wolficon.jpg?w=32
  probed_at: "2026-10-07T11:51:36.713Z"
---

# 🕐 Remember When Lists Could Sort By Any Key? 🔄

[Read the post](https://gerardorenteria.blog/2025/12/01/%f0%9f%95%90-remember-when-lists-could-sort-by-any-key-%f0%9f%94%84/) · Gerardo Renteria (Gerardo Renteria) · 2025-12-01 · 1180 words · tier community · reviewed (checked by Opus)

> A developer creates a solution to sort Business Central list pages by any predefined table key, not just single fields. The pattern uses temporary metadata storage, dynamic RecordRef reflection, and page extensions to offer flexible multi-field sorting that restores functionality from the NAV/C/SIDE era.

## Key points

- Tables in Business Central have predefined keys optimized for data retrieval; the solution leverages these keys to enable sorting by multiple fields in order.
- The architecture consists of a temporary table for metadata, a codeunit using RecordRef to read table keys, and a selection page that lets users choose which key to sort by.
- When a user selects a sort order, a new list window opens with the applied sorting, while the original remains unchanged.
- Page extensions add a 'Change Sort Order' action to any list page, making the feature reusable across tables like Customer and Sales Order.
- The solution includes example extensions and permission set configuration for integration into daily Business Central workflows.

## Quotes

- "Every BC table has predefined keys designed for optimal data retrieval and sorting." (Explains why leveraging table keys instead of arbitrary field combinations makes sense for performance and intentional sorting patterns.)
- "After selecting the desired key, a new customer list window will open with the additional key title." (Shows that the solution preserves the original view while opening a separate sorted view, allowing users to compare sort orders without losing context.)

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

- table "GDRG Table Key"
- codeunit "GDRGKeyManager"
- page "GDRG Key Selection"
- [page 22 "Customer List"](../../objects/page/22.md)
- permissionset "GDRGKeyManager"

Not found in BC28-30: table "GDRG Table Key", codeunit "GDRGKeyManager", page "GDRG Key Selection", permissionset "GDRGKeyManager".

## Context

- Features: custom sort orders, table key reflection, multi-field sorting, page extensions, dynamic table opening, selection dialog

Source: Gerardo Renteria, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.
