bcquality/microsoft/knowledge/ui/list-page-document-routing-uses-page-management.bad.al
Michael Dieringer 750466c7f3 Add UI knowledge: notification recall Id and Page Management document routing
Two ui articles with compiled good/bad samples:
- notification-recall-needs-known-id: a notification that the code also
  recalls needs a fixed Id (single instance; recall before re-send) or
  per-record tracking through codeunit "Notification Lifecycle Mgt."
  (SendNotification[WithAdditionalContext] / RecallNotificationsForRecord,
  HandleDelayedInsert semantics). Never-recalled notifications are exempt.
- list-page-document-routing-uses-page-management: open documents from a
  mixed-type list with PageManagement.PageRun(Rec) instead of a hand-written
  case "Document Type" / Page.Run; register new tables through
  OnConditionalCardPageIDNotFound. Single-type opens and tables Page
  Management does not route are exempt.

Wired into al-ui-review (entry gate now covers notification send/recall
outside pages, tokens, high-signal mappings) and registered both pairs in
the ui review-fixtures override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 12:47:57 +02:00

52 lines
1.6 KiB
AL

page 50730 "Sample Open Sales Docs"
{
PageType = List;
SourceTable = "Sales Header";
Editable = false;
ApplicationArea = Basic, Suite;
UsageCategory = Lists;
Caption = 'Sample Open Sales Documents';
layout
{
area(Content)
{
repeater(Documents)
{
field("Document Type"; Rec."Document Type") { }
field("No."; Rec."No.") { }
field("Sell-to Customer Name"; Rec."Sell-to Customer Name") { }
}
}
}
actions
{
area(Processing)
{
action(ShowDocument)
{
Caption = 'Show Document';
Image = EditLines;
ShortCutKey = 'Return';
ToolTip = 'Open the selected sales document.';
trigger OnAction()
begin
// Copies the Sales Header mapping that Page Management
// already holds; Blanket Order and Return Order rows open nothing.
case Rec."Document Type" of
Rec."Document Type"::Quote:
Page.Run(Page::"Sales Quote", Rec);
Rec."Document Type"::Order:
Page.Run(Page::"Sales Order", Rec);
Rec."Document Type"::Invoice:
Page.Run(Page::"Sales Invoice", Rec);
Rec."Document Type"::"Credit Memo":
Page.Run(Page::"Sales Credit Memo", Rec);
end;
end;
}
}
}
}