From b520360f52d619582f539d39bedcfdc2e49a019f Mon Sep 17 00:00:00 2001 From: Teddy Herryanto <72045245+thatnavguy@users.noreply.github.com> Date: Mon, 15 Jun 2026 06:42:09 +0200 Subject: [PATCH] Add Default descending sort on historical pages --- ...descending-sort-on-historical-pages.bad.al | 29 ++++++++++++++++++ ...escending-sort-on-historical-pages.good.al | 30 +++++++++++++++++++ ...ult-descending-sort-on-historical-pages.md | 23 ++++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 community/knowledge/ui/default-descending-sort-on-historical-pages.bad.al create mode 100644 community/knowledge/ui/default-descending-sort-on-historical-pages.good.al create mode 100644 community/knowledge/ui/default-descending-sort-on-historical-pages.md diff --git a/community/knowledge/ui/default-descending-sort-on-historical-pages.bad.al b/community/knowledge/ui/default-descending-sort-on-historical-pages.bad.al new file mode 100644 index 0000000..42201ad --- /dev/null +++ b/community/knowledge/ui/default-descending-sort-on-historical-pages.bad.al @@ -0,0 +1,29 @@ +page 50100 "Integration Log Entries" +{ + PageType = List; + SourceTable = "Integration Log Entry"; + ApplicationArea = All; + UsageCategory = History; + Caption = 'Integration Log Entries'; + + // No descending default sort: the page opens oldest-first. + + layout + { + area(Content) + { + repeater(General) + { + field("Entry No."; Rec."Entry No.") + { + } + field(Status; Rec.Status) + { + } + field(Message; Rec.Message) + { + } + } + } + } +} \ No newline at end of file diff --git a/community/knowledge/ui/default-descending-sort-on-historical-pages.good.al b/community/knowledge/ui/default-descending-sort-on-historical-pages.good.al new file mode 100644 index 0000000..8d2e75b --- /dev/null +++ b/community/knowledge/ui/default-descending-sort-on-historical-pages.good.al @@ -0,0 +1,30 @@ +page 50100 "Integration Log Entries" +{ + PageType = List; + SourceTable = "Integration Log Entry"; + ApplicationArea = All; + UsageCategory = History; + Caption = 'Integration Log Entries'; + + // Historical pages should open with the newest records first. + SourceTableView = order(descending); + + layout + { + area(Content) + { + repeater(General) + { + field("Entry No."; Rec."Entry No.") + { + } + field(Status; Rec.Status) + { + } + field(Message; Rec.Message) + { + } + } + } + } +} \ No newline at end of file diff --git a/community/knowledge/ui/default-descending-sort-on-historical-pages.md b/community/knowledge/ui/default-descending-sort-on-historical-pages.md new file mode 100644 index 0000000..185e56f --- /dev/null +++ b/community/knowledge/ui/default-descending-sort-on-historical-pages.md @@ -0,0 +1,23 @@ +--- +bc-version: [all] +domain: ui +keywords: [historical-table, list-page, descending-sort, log-entry, ledger-entry, archive] +technologies: [al] +countries: [w1] +application-area: [all] +--- + +# Default descending sort on historical pages + +## Description +Historical list pages should default to showing the newest records first. On pages such as log entries, ledger entries, archives, and other history lists, an oldest-first default order does not align with the primary use of the page, which is typically to review recent activity. + +## Best Practice +Set descending sort as the default on list pages whose primary purpose is to present historical records. This is the expected default for entry, log, archive, and posted-history pages unless there is a specific requirement to begin with the oldest record. + +See sample: `default-descending-sort-on-historical-pages.good.al`. + +## Anti Pattern +Using an oldest-first default order on a historical list page where users are primarily interested in recent activity. Typical signs include history, log, or entry pages that regularly need to be re-sorted to descending during normal use. + +See sample: `default-descending-sort-on-historical-pages.bad.al`. \ No newline at end of file