bcquality/microsoft/knowledge/web-services/api-enum-values-are-a-contract-by-name-not-ordinal.bad.al
Jesper Schulz-Wedde 4f0a13a801
Promote knowledge for Microsoft review skills (#153)
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>

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
Copilot-Session: 2a6ea875-d38e-4f30-aadb-0d606f9be231
2026-09-03 15:06:01 +02:00

52 lines
1.4 KiB
AL

// Ordinal 2 was renamed from CreditNote to CreditMemo with ordinal and caption kept. The compiler stays silent
// and AS0082 fires only against a baseline; every schema 2.0 consumer that filters on or posts CreditNote fails.
enum 50120 "Document Kind Bad"
{
Extensible = true;
value(0; Invoice) { Caption = 'Invoice'; }
value(1; Order) { Caption = 'Order'; }
value(2; CreditMemo) { Caption = 'Credit Memo'; }
}
table 50121 "Document Header Bad"
{
DataClassification = CustomerContent;
fields
{
field(1; "No."; Code[20]) { DataClassification = CustomerContent; }
field(2; Kind; Enum "Document Kind Bad") { DataClassification = CustomerContent; }
}
keys
{
key(PK; "No.") { Clustered = true; }
}
}
page 50122 "Document API Bad"
{
PageType = API;
APIPublisher = 'contoso';
APIGroup = 'documents';
APIVersion = 'v1.0';
EntityName = 'document';
EntitySetName = 'documents';
ODataKeyFields = SystemId;
SourceTable = "Document Header Bad";
DelayedInsert = true;
layout
{
area(content)
{
repeater(records)
{
field(id; Rec.SystemId) { Caption = 'id'; Editable = false; }
field(number; Rec."No.") { Caption = 'number'; }
field(kind; Rec.Kind) { Caption = 'kind'; }
}
}
}
}