bcquality/microsoft/knowledge/data-modeling/xrec-is-a-before-image-only-in-some-triggers.bad.al
Jesper Schulz-Wedde 42ff075793 Promote knowledge for Microsoft review skills
Move canonical knowledge for Microsoft-owned review domains into the Microsoft layer and document the skill/knowledge co-location policy.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 2a6ea875-d38e-4f30-aadb-0d606f9be231
2026-09-03 14:59:44 +02:00

36 lines
978 B
AL

table 50130 "Service Request"
{
fields
{
field(1; "No."; Code[20])
{
DataClassification = CustomerContent;
}
field(2; Status; Enum "Service Request Status")
{
DataClassification = CustomerContent;
}
}
keys
{
key(PK; "No.")
{
Clustered = true;
}
}
trigger OnModify()
begin
// Dead branch under any code-driven Modify: from code xRec mirrors Rec, so
// the two Status values are always equal and LogStatusChange never runs.
// Editing the field on a page DOES populate xRec, so this passes manual
// testing and then silently does nothing in a job queue or API call.
if Status <> xRec.Status then
LogStatusChange(xRec.Status, Status);
end;
local procedure LogStatusChange(FromStatus: Enum "Service Request Status"; ToStatus: Enum "Service Request Status")
begin
end;
}