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

24 lines
849 B
AL

pageextension 50720 "Sample Customer Card Ext" extends "Customer Card"
{
trigger OnAfterGetCurrRecord()
var
NoCreditLimitNotification: Notification;
begin
// A fixed Id lets this code recall the notification it sent earlier.
NoCreditLimitNotification.Id := GetNoCreditLimitNotificationId();
NoCreditLimitNotification.Recall();
if Rec."Credit Limit (LCY)" = 0 then begin
NoCreditLimitNotification.Message := NoCreditLimitMsg;
NoCreditLimitNotification.Scope := NotificationScope::LocalScope;
NoCreditLimitNotification.Send();
end;
end;
local procedure GetNoCreditLimitNotificationId(): Guid
begin
exit('6f0c2b8e-4a1d-4f7e-9b3a-2d5e8c1f7a40');
end;
var
NoCreditLimitMsg: Label 'This customer has no credit limit.';
}