bcquality/microsoft/knowledge/ui/notification-recall-needs-known-id.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

20 lines
774 B
AL

pageextension 50720 "Sample Customer Card Ext" extends "Customer Card"
{
trigger OnAfterGetCurrRecord()
var
NoCreditLimitNotification: Notification;
begin
if Rec."Credit Limit (LCY)" = 0 then begin
// No Id is assigned: Send assigns one that this code never keeps.
NoCreditLimitNotification.Message := NoCreditLimitMsg;
NoCreditLimitNotification.Scope := NotificationScope::LocalScope;
NoCreditLimitNotification.Send();
end else
// This new variable has no Id, so the warning sent for the
// previous customer is not withdrawn.
NoCreditLimitNotification.Recall();
end;
var
NoCreditLimitMsg: Label 'This customer has no credit limit.';
}