← Back to Benchmark Results

openrouter/minimax/minimax-m2.5

53.6%
Pass Rate
30/56
Tasks Passed
3
Runs
45.2%
pass@1
53.6%
pass@3
83.9%
Consistency
0.1
Temperature
-
Thinking
815,904
Tokens
$9.48
Cost
1st: 472nd: 29Failed: 2630/56 passed

Known Shortcomings (32)

Sorted by occurrence count (most frequent first)

# Concept AL Concept Count Affected Tasks
1 json-object-key-iteration json-api-usage 3 CG-AL-M021, CG-AL-H014, CG-AL-M020

Description: The model used 'Key' as a variable or keyword in an invalid context when iterating over JsonObject keys. In AL, to iterate over JsonObject members you must use JsonObject.Keys (which returns a List of Text) and iterate with a foreach loop using proper variable declarations. The model likely wrote something like 'Key : ...' or used 'Key' as a reserved word incorrectly at lines 58, 91, 126, and 167, causing AL0519 errors ('Key' is not valid value in this context). The correct pattern is to declare a Text variable (e.g., KeyName) and use 'foreach KeyName in JsonObj.Keys do' or use JsonObject.Get(KeyName, JToken) pattern.

Correct Pattern:
Declare a Text variable like 'KeyName: Text;' and iterate using 'foreach KeyName in JObj.Keys do begin ... end;' — avoid using 'Key' as a bare identifier or in contexts where AL interprets it as an invalid value.
Incorrect Pattern:
Key (used as identifier/keyword at lines 58, 91, 126, 167 causing syntax errors)

Error Codes: AL0519, AL0133, AL0132

2 interface-definition-syntax interface-definition 2 CG-AL-E008, CG-AL-H015

Description: The model failed to generate any valid AL code (generated code not found / empty). The compilation errors (AL0107: identifier expected, AL0198: expected application object keyword) indicate the model likely produced malformed or empty output instead of a proper AL interface definition. AL interfaces do not use numeric IDs (unlike codeunits, tables, etc.), and the task description incorrectly mentions 'ID 70000' for an interface. However, the core issue is that the model did not produce a valid interface definition at all. A correct AL interface would use the syntax: interface "Payment Processor" { ... } without an ID number. The model also needed to produce a mock codeunit implementing the interface for the tests to work, but it failed to generate even the basic interface.

Correct Pattern:
interface "Payment Processor"
{
    Access = Public;

    /// <summary>
    /// Processes a payment for the given amount and method.
    /// </summary>
    procedure ProcessPayment(Amount: Decimal; PaymentMethod: Text): Boolean;

    /// <summary>
    /// Validates the given payment data.
    /// </summary>
    procedure ValidatePayment(PaymentData: Text): Boolean;

    /// <summary>
    /// Gets the transaction fee for the given amount.
    /// </summary>
    procedure GetTransactionFee(Amount: Decimal): Decimal;
}
Incorrect Pattern:
// Generated code not found (empty or malformed output)

Error Codes: AL0107, AL0104, AL0198

3 multiline-string-literals string-operations 2 CG-AL-E050, CG-AL-E051

Description: The model attempted to use 'StrSubstituteNoCase' which does not exist in AL. The task required using multiline string literals (a relatively newer AL feature) and the model either didn't know the correct syntax for multiline strings or tried to use a non-existent function for string substitution. In AL, multiline string literals use the syntax starting with @' or the newer text constant approach, and for string substitution, the correct function is StrSubstNo (or Text.StrSubstNo). The model used 'StrSubstituteNoCase' which is not a valid AL built-in function.

Correct Pattern:
Use StrSubstNo('%1', CustomerName) for string substitution and multiline text literals using the syntax: Result := 'SELECT CustomerNo, Name, Balance' + Environment.NewLine + 'FROM Customer' + ... or use AL multiline string literals if supported by the target runtime version.
Incorrect Pattern:
StrSubstituteNoCase

Error Codes: AL0118

4 text-char-conversion-copystr string-manipulation 1 CG-AL-E005

Description: The model generated code that attempts to use a Text value where a Char is expected, likely in the CapitalizeFirstLetter procedure. In AL, indexing into a Text variable (e.g., InputText[1]) returns a Char, and operations like UpperCase() work on Text, not Char. The model likely wrote something like `UpperCase(InputText[1])` or tried to assign a Text result back to a Char position without proper conversion using CopyStr and Format. The correct pattern is to use CopyStr to extract substrings and UpperCase on Text values, then concatenate the results.

Correct Pattern:
procedure CapitalizeFirstLetter(InputText: Text): Text
begin
    if InputText = '' then
        exit('');
    exit(UpperCase(CopyStr(InputText, 1, 1)) + CopyStr(InputText, 2));
end;
Incorrect Pattern:
Cannot implicitly convert type 'Text' to 'Char' - likely attempted something like: InputText[1] := UpperCase(CopyStr(InputText, 1, 1))

Error Codes: AL0122

5 page-object-definition card-page-creation 1 CG-AL-E002

Description: The model failed to generate valid AL code for a card page. The generated code file appears to be empty or contain invalid content that doesn't even start with a proper AL page object declaration. The compilation errors (AL0104 'Syntax error, } expected' and AL0198 'Expected one of the application object keywords') at line 10 indicate the model produced something that is not a valid AL object definition. The task asked for a straightforward card page (ID 70001) based on a table (ID 69001) with four fields, which is a fundamental AL development task.

Correct Pattern:
page 70001 "Product Category Card"
{
    PageType = Card;
    SourceTable = "Product Category";
    Caption = 'Product Category Card';

    layout
    {
        area(Content)
        {
            group(General)
            {
                field(Code; Rec.Code)
                {
                    ApplicationArea = All;
                }
                field(Description; Rec.Description)
                {
                    ApplicationArea = All;
                }
                field(Active; Rec.Active)
                {
                    ApplicationArea = All;
                }
                field("Created Date"; Rec."Created Date")
                {
                    ApplicationArea = All;
                }
            }
        }
    }
}
Incorrect Pattern:
// Generated code not found (empty or invalid output at line 10)

Error Codes: AL0104

6 event-subscriber-attribute-syntax event-subscriber 1 CG-AL-E010

Description: The model generated an EventSubscriber attribute with only 3 arguments, but the AL compiler requires more arguments for the EventSubscriber attribute. In Business Central AL, the [EventSubscriber] attribute for a table event like OnAfterInsertEvent requires specifying ObjectType, ObjectId, ElementName, SkipOnMissingLicense, and SkipOnMissingPermission parameters (or the newer named-parameter syntax). The model likely wrote something like [EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterInsertEvent')] with only 3 positional arguments, whereas the correct syntax requires additional parameters such as the element name (empty string for table triggers) and boolean flags, e.g., [EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterInsertEvent', '', false, false)].

Correct Pattern:
[EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterInsertEvent', '', false, false)]
local procedure OnAfterInsertItem(var Rec: Record Item)
begin
    Message('New item created: %1', Rec."No.");
end;
Incorrect Pattern:
[EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterInsertEvent')]

Error Codes: AL0238

7 page-extension-and-table-extension-generation al-object-structure 1 CG-AL-E006

Description: The model failed to generate any valid AL code. The task required creating a page extension (ID 70000) extending the Customer Card (page 21) along with a table extension to add new fields ('Preferred Contact Method', 'Customer Notes', 'VIP Customer') to the Customer table. The compilation errors (AL0104 syntax error at line 3, AL0198 expecting an application object keyword) indicate the model produced malformed or empty/incomplete output that doesn't even begin with a valid AL object declaration. The model needed to produce both a tableextension (to add the fields to the Customer table) and a pageextension (to display them on the Customer Card), but it apparently generated no recognizable AL code at all.

Correct Pattern:
tableextension 70000 "Customer Table Extension" extends Customer
{
    fields
    {
        field(50000; "Preferred Contact Method"; Option)
        {
            Caption = 'Preferred Contact Method';
            OptionMembers = Email,Phone,Mail,SMS;
            OptionCaption = 'Email,Phone,Mail,SMS';
        }
        field(50001; "Customer Notes"; Text[500])
        {
            Caption = 'Customer Notes';
        }
        field(50002; "VIP Customer"; Boolean)
        {
            Caption = 'VIP Customer';
        }
    }
}

pageextension 70000 "Customer Card Extension" extends "Customer Card"
{
    layout
    {
        addlast(General)
        {
            field("Preferred Contact Method"; Rec."Preferred Contact Method")
            {
                ApplicationArea = All;
                Caption = 'Preferred Contact Method';
            }
            field("Customer Notes"; Rec."Customer Notes")
            {
                ApplicationArea = All;
                Caption = 'Customer Notes';
            }
            field("VIP Customer"; Rec."VIP Customer")
            {
                ApplicationArea = All;
                Caption = 'VIP Customer';
            }
        }
    }
}
Incorrect Pattern:
// Generated code not found (the output was empty or completely malformed, failing at line 3 with syntax errors)

Error Codes: AL0104

8 dictionary-iteration-syntax dictionary-type-usage 1 CG-AL-H018

Description: The model generated code that uses 'Key' as a variable or keyword in the context of iterating over a Dictionary of [Text, Text], which is not valid AL syntax. The compilation error AL0519 at line 45 indicates the model wrote something like 'Key' when iterating over dictionary entries in the Build() procedure. In AL, to iterate over a Dictionary you must use the Keys() method to get a List of keys and then iterate with foreach, e.g., 'foreach HeaderKey in RequestHeaders.Keys() do'. The model likely attempted an invalid pattern for dictionary iteration.

Correct Pattern:
var HeaderKey: Text; HeaderKeys: List of [Text]; ... HeaderKeys := RequestHeaders.Keys(); foreach HeaderKey in HeaderKeys do begin RequestHeaders.Get(HeaderKey, HeaderValue); ... end;
Incorrect Pattern:
Key (at line 45 - likely something like 'for Key in RequestHeaders do' or similar invalid dictionary iteration)

Error Codes: AL0519

9 complex-codeunit-syntax-structure codeunit-procedure-syntax 1 CG-AL-H023

Description: The model generated code with a syntax error at line 142 - likely an incomplete or malformed procedure body, missing 'end' keyword, or incorrect nesting of begin/end blocks. The compilation errors (AL0104: 'end' expected, ';' expected, '}' expected) all point to line 142 column 33, indicating the model produced structurally invalid AL code in a complex codeunit with 10 procedures. The generated code was not captured/found but the errors clearly indicate the model failed to produce syntactically valid AL for this complex multi-procedure codeunit with interfaces, RecordRef/FieldRef manipulation, and various parameter types.

Correct Pattern:
Each procedure must have properly matched begin/end blocks, and the codeunit must close with 'end;' followed by '}'. Complex codeunits with many procedures require careful nesting of control structures.
Incorrect Pattern:
// Generated code not found - but line 142 has syntax error with missing 'end', ';', and '}'

Error Codes: AL0104

10 al-syntax-semicolons-and-control-flow codeunit-implementation 1 CG-AL-M005

Description: The model generated AL code with multiple syntax errors including missing semicolons, incorrect control flow structures (missing 'until' in repeat-until loops), and malformed code blocks. The errors at lines 78, 101, 107, 110, 177, 192, and 195 indicate the model produced syntactically invalid AL code with issues in loop constructs, statement termination, and object structure. The generated code was not even captured ('Generated code not found'), but the compilation errors clearly show the model failed to produce valid AL syntax for a codeunit implementing HTTP client patterns, retry logic, and JSON handling.

Correct Pattern:
codeunit 70002 "External Payment Service"
{
    procedure SendPaymentRequest(OrderId: Text; Amount: Decimal; Currency: Text; var ResponseJson: JsonObject): Boolean
    var
        Client: HttpClient;
        RequestMsg: HttpRequestMessage;
        ResponseMsg: HttpResponseMessage;
        Content: HttpContent;
        RequestJson: JsonObject;
        ResponseText: Text;
        RetryCount: Integer;
        MaxRetries: Integer;
    begin
        MaxRetries := 3;
        RequestJson.Add('orderId', OrderId);
        RequestJson.Add('amount', Amount);
        RequestJson.Add('currency', Currency);
        // ... proper retry loop with repeat-until and semicolons
        repeat
            RetryCount += 1;
            // HTTP call logic
        until (RetryCount >= MaxRetries);
        exit(false);
    end;
    // ... other procedures with proper AL syntax
}
Incorrect Pattern:
Generated code not available but compilation errors indicate: missing semicolons at multiple locations, incorrect repeat-until loop syntax, and malformed object structure causing 'Expression expected' and unexpected token errors

Error Codes: AL0111

11 report-dataset-column-syntax report-definition 1 CG-AL-M007

Description: The model generated a report with incorrect dataset/column syntax. The compilation errors at lines 30 and 40 indicate the model used incorrect syntax for defining report columns in the dataset section. The errors 'field expected', '(' expected', ')' expected' suggest the model likely used an incorrect pattern for column definitions in the report's dataset, possibly using expression-based columns or incorrect field reference syntax instead of the proper AL report column() syntax. The task and tests are valid - the tests check both the report existence/execution and a separate MockCalculator codeunit for business logic. The model failed to produce syntactically correct AL code for the report object.

Correct Pattern:
Report dataset columns should use syntax like: column(ColumnName; FieldOrExpression) { } within a dataitem() block. For example: dataitem(Customer; Customer) { column(CustomerNo; "No.") { } column(CustomerName; Name) { } }
Incorrect Pattern:
Generated code not available, but errors at line 30:57 and 40:53/40:90 indicate incorrect column definitions in the report dataset, likely using invalid syntax where 'column(Name; Expression)' pattern was expected

Error Codes: AL0104

12 al-procedure-parameter-syntax procedure-definition 1 CG-AL-M008

Description: The model generated AL code with syntax errors at specific line positions (lines 48, 80, 88) where commas were expected. The AL0104 errors at these positions indicate the model likely used incorrect parameter syntax in procedure definitions - possibly using semicolons instead of commas in certain contexts, or incorrectly formatting parameter lists. The errors occur in the generated codeunit file (CG-AL-M008.al), not in the test file. The task and test definitions are valid; the model simply produced syntactically incorrect AL code for procedure parameters or variable declarations. In AL, procedure parameters are separated by semicolons (not commas), but certain contexts like array indexers or built-in function calls use commas. The model likely confused these contexts or used incorrect syntax in expressions within the procedure bodies.

Correct Pattern:
In AL, procedure parameters use semicolons as separators: procedure ProcessApprovalRequest(DocumentNo: Code[20]; Action: Text; Comment: Text): Boolean. Expressions and function call arguments use commas where appropriate. The model should ensure proper AL syntax for all procedure signatures and body expressions.
Incorrect Pattern:
Generated code not available in full, but compilation errors at lines 48, 80, and 88 indicate syntax issues with comma/semicolon usage in parameter lists or expressions

Error Codes: AL0104

13 onprem-scope-file-operations-and-boolean-operators extension-development-restrictions 1 CG-AL-M009

Description: The model made two categories of errors: (1) It used File system operations (Exists, Open, Create, Write, Close) which have scope 'OnPrem' and cannot be used in Extension development. This was likely part of the 'logging and audit trail functionality' requested in the task - the model tried to implement file-based logging instead of using table-based logging or Message/Error patterns suitable for extensions. (2) It used incorrect boolean/logical operators on Text and Integer types (e.g., 'Text or Text' instead of '(Text = '''') or (Text = '''')' and 'Integer and Integer' instead of proper boolean expressions). These are fundamental AL knowledge gaps about the Extension development target restrictions and proper AL operator usage.

Correct Pattern:
For logging/audit trail: use a custom table to store log entries instead of file operations. For boolean logic: use proper boolean expressions like '(Street = '''') or (City = '''')' instead of applying 'or' directly to Text operands, and use proper boolean comparisons for Integer values.
Incorrect Pattern:
File.Exists(...), File.Open(...), File.Create(...), File.Write(...), File.Close(...), and expressions like 'TextVar or TextVar' and 'IntVar and IntVar'

Error Codes: AL0296

14 multi-object-al-syntax al-object-definition 1 CG-AL-M010

Description: The model generated code with syntax errors at line 53 of the output file. The compilation errors (AL0104, AL0114, AL0198) all point to line 53, suggesting the model produced malformed AL syntax in a single file containing multiple objects. The errors about expecting ')', ';', '}', integer literals, identifiers, '{', and application object keywords indicate the model likely wrote an incorrect field definition, procedure signature, or option value syntax (possibly involving spaces in option values without proper quoting, or incorrect procedure parameter syntax like using Text[100] in a way the parser couldn't handle). The generated code was noted as 'not found' in the prompt but the compilation errors clearly show the model produced code that failed to parse. Given the task requires multiple AL objects (2 tables, 1 page, 1 codeunit) with proper syntax across all of them, the model failed to produce syntactically valid AL code.

Correct Pattern:
For CreateProject procedure: procedure CreateProject(Name: Text[100]; StartDate: Date): Code[20] - parameters and return type must use proper AL syntax. Option values with spaces like 'In Progress' and 'On Hold' must be properly quoted in OptionMembers. All objects must be properly structured with correct begin/end blocks.
Incorrect Pattern:
Line 53 content unknown - generated code marked as 'not found' but compilation errors reference CG-AL-M010.al:53 with multiple syntax errors suggesting malformed procedure signature or field definition

Error Codes: AL0104

15 json-token-iteration json-handling 1 CG-AL-M020

Description: The model generated code that uses an 'Iterator' type which does not exist in AL. The compilation error AL0134 indicates the model tried to use 'Iterator' as a type, likely when iterating over JSON tokens or array elements. In AL/Business Central, JSON array iteration is done using JsonArray.Get(Index, JsonToken) with a for loop over JsonArray.Count, not with an iterator pattern. The model lacks knowledge of proper AL JSON API patterns for iterating arrays and extracting values from JsonObject/JsonArray/JsonToken/JsonValue types.

Correct Pattern:
Use 'for i := 0 to ValuesArray.Count - 1 do begin ValuesArray.Get(i, JToken); JValue := JToken.AsValue(); Sum += JValue.AsInteger(); end;' pattern with JsonToken and JsonValue types for array iteration.
Incorrect Pattern:
Iterator is not recognized as a valid type (line 65)

Error Codes: AL0134

16 page-extension-cardpageid-override page-extension-syntax 1 CG-AL-E053

Description: The model generated syntactically invalid AL code for a page extension. The compilation errors indicate fundamental syntax issues starting at line 3 (likely incorrect property or keyword placement) and line 12 (incorrect action definition syntax). The task requires using the BC 2025 Wave 1 feature to override CardPageId on a list page extension, which is a newer feature the model likely doesn't know about. The model appears to have produced malformed AL code with incorrect syntax for the pageextension object, the CardPageId property placement, and/or the action definition structure.

Correct Pattern:
pageextension 70053 "CG Item List Extension" extends "Item List"
{
    CardPageId = "Item Card";

    actions
    {
        addlast(Processing)
        {
            action("Show Item Details")
            {
                ApplicationArea = All;
                Caption = 'Show Item Details';
                Image = Card;
                RunObject = page "Item Card";
                RunPageLink = "No." = field("No.");
            }
        }
    }
}
Incorrect Pattern:
Generated code not available but errors suggest incorrect syntax at line 3 (possibly CardPageId property placement) and line 12 (action definition with incorrect syntax)

Error Codes: AL0104

17 table-field-property-usage table-definition 1 CG-AL-H003

Description: The model generated a table definition for 'CG Discount Result' (ID 70203) where it incorrectly applied the 'TableRelation' property on a field where it cannot be used in that context. The compilation error AL0124 indicates 'The property TableRelation cannot be used in this context', meaning the model likely added a TableRelation property on a field type (such as an Integer or Decimal field) where it is not applicable, or used it incorrectly. The model failed to understand which field types and contexts support the TableRelation property in AL table definitions. Additionally, the generated code was not captured/found properly, but the compilation error clearly points to line 50 of the generated .al file where an invalid TableRelation property was placed.

Correct Pattern:
table 70203 "CG Discount Result"
{
    DataClassification = ToBeClassified;
    TableType = Temporary;

    fields
    {
        field(1; "Line No."; Integer) { }
        field(2; "Item No."; Code[20]) { }
        field(3; "Original Price"; Decimal) { }
        field(4; "Discount Percent"; Decimal) { }
        field(5; "Final Price"; Decimal) { }
    }

    keys
    {
        key(PK; "Line No.") { Clustered = true; }
    }
}
Incorrect Pattern:
TableRelation on a field where it is not applicable (e.g., on 'Line No.' Integer field or a Decimal field in the CG Discount Result table)

Error Codes: AL0124

18 parse-failure unknown 1 CG-AL-E052

Description: Failed to parse LLM analysis response: Looking at the failure details: 1. The generated code compiled successfully and most tests passed 2. Only `TestDateToText_ValidDate` and `TestDateToText_FirstDayOfYear` failed 3. The test for `TestDa

Correct Pattern:
Incorrect Pattern:
19 calcfields-with-setloadfields flowfield 1 CG-AL-M023

Description: The model's SumItemInventory procedure returns 0 instead of the correct sum. This indicates the model likely either forgot to call CalcFields(Inventory) before reading the Inventory FlowField value, or failed to properly accumulate the sum. When using SetLoadFields for partial record loading, FlowFields like Inventory are not loaded by SetLoadFields and must be explicitly calculated via CalcFields before their value can be read. The model appears to not understand this interaction between SetLoadFields and CalcFields.

Correct Pattern:
procedure SumItemInventory(): Decimal
var
    Item: Record Item;
    TotalSum: Decimal;
begin
    TotalSum := 0;
    Item.SetLoadFields("No.");
    if Item.FindSet() then
        repeat
            Item.CalcFields(Inventory);
            TotalSum += Item.Inventory;
        until Item.Next() = 0;
    exit(TotalSum);
end;
Incorrect Pattern:
// Generated code not available, but SumItemInventory returns 0 instead of the correct inventory sum
20 text-type-methods al-text-data-type 1 CG-AL-E005

Description: The model used 'Text.IsEmpty' method which does not exist on the AL Text data type. In AL, to check if a text variable is empty, you should compare it to an empty string literal (e.g., `if InputText = '' then`) or use `StrLen(InputText) = 0`. The model incorrectly assumed that the Text type has an IsEmpty() method, likely confusing it with .NET string methods or other language conventions.

Correct Pattern:
Use `if InputText = '' then` or `if StrLen(InputText) = 0 then` instead of `InputText.IsEmpty`
Incorrect Pattern:
InputText.IsEmpty (used on lines 10, 23, and 32 of the generated codeunit)

Error Codes: AL0132

21 table-type-datapercompany temporary-table-definition 1 CG-AL-H003

Description: The model generated a table definition for 'CG Discount Result' (ID 70203) that included 'DataPerCompany = false' without also setting 'TableType = Normal' (or it set a non-Normal TableType). In AL, the property 'DataPerCompany' can only be used when 'TableType' is set to 'Normal' (which is the default). The model likely set TableType to something like 'Temporary' thinking the table would only be used as a temporary record, and also set DataPerCompany = false, causing compilation error AL0223. The correct approach is to define the table as a normal table (default TableType) without specifying DataPerCompany, or if DataPerCompany is needed, ensure TableType = Normal. The 'temporary' keyword belongs on the variable declaration, not on the table definition itself.

Correct Pattern:
table 70203 "CG Discount Result"
{
    DataClassification = ToBeClassified;

    fields
    {
        field(1; "Line No."; Integer) { }
        field(2; "Item No."; Code[20]) { }
        field(3; "Original Price"; Decimal) { }
        field(4; "Discount Percent"; Decimal) { }
        field(5; "Final Price"; Decimal) { }
    }

    keys
    {
        key(PK; "Line No.") { Clustered = true; }
    }
}

// The 'temporary' keyword is used on the variable declaration, not on the table:
// var TempResult: Record "CG Discount Result" temporary;
Incorrect Pattern:
table 70203 "CG Discount Result"
{
    DataPerCompany = false;
    TableType = Temporary;
    ...
}

Error Codes: AL0223

22 errorinfo-create-pattern errorinfo-api-usage 1 CG-AL-H007

Description: The model incorrectly used ErrorInfo.Create() as a static method call without assigning the return value, and then tried to access instance members (CustomDimensions, Collectible) on the ErrorInfo type rather than on an instance. In AL, ErrorInfo.Create() returns a new ErrorInfo instance that must be captured in a variable. Then CustomDimensions and Collectible must be called on that instance. The model likely wrote something like: ErrorInfo.Create(); ErrorInfo.CustomDimensions(...); instead of: ErrInfo := ErrorInfo.Create(); ErrInfo.CustomDimensions(...); Additionally, the AL0122 error suggests a type confusion, possibly declaring a local variable with the same name as the type.

Correct Pattern:
var
    ErrInfo: ErrorInfo;
    Dims: Dictionary of [Text, Text];
begin
    ErrInfo := ErrorInfo.Create();
    ErrInfo.Message(ErrorMessage);
    Dims.Add('ErrorCode', Format(ErrorCode.AsInteger()));
    Dims.Add('FieldName', FieldName);
    ErrInfo.CustomDimensions(Dims);
    ErrInfo.Collectible(IsCollectingErrors());
    exit(ErrInfo);
end;
Incorrect Pattern:
ErrorInfo.Create();
ErrorInfo.CustomDimensions(...);
ErrorInfo.Collectible(...);
exit(ErrorInfo);

Error Codes: AL0192

23 query-object-syntax query-definition 1 CG-AL-H011

Description: The model failed to generate valid AL code for a query object. The compilation errors (AL0104 syntax error at line 22, expecting '}' or application object keyword) indicate the model produced syntactically invalid AL for the query object definition. The generated code was either empty, incomplete, or structurally malformed. The model lacks knowledge of the correct AL query object syntax including dataitem definitions, column definitions with Method properties (Sum, Count), filter elements with ColumnFilter, and OrderBy clauses.

Correct Pattern:
query 70011 "CG Sales Summary"
{
    QueryType = Normal;
    OrderBy = ascending(Sell_to_Customer_No);

    elements
    {
        dataitem(SalesLine; "Sales Line")
        {
            column(Document_No; "Document No.") { }
            column(Sell_to_Customer_No; "Sell-to Customer No.") { }
            column(Line_Amount_Sum; "Line Amount") { Method = Sum; }
            column(Line_Count; "Line Amount") { Method = Count; }
            filter(Document_Type; "Document Type") { ColumnFilter = const(Order); }
        }
    }
}
Incorrect Pattern:
// Generated code not found (or syntactically invalid query object)

Error Codes: AL0104

24 query-column-expression-property query-object-definition 1 CG-AL-H017

Description: The model generated a query object that incorrectly used the 'Expression' property on query columns. In AL query objects, the 'Expression' property is not valid for regular columns. The model likely tried to use Expression to define computed or mapped columns, but in AL queries, columns are defined by referencing source fields directly using the 'column' keyword with a SourceExpr or by specifying the field name. For a Count method column, you use Method = Count on the column definition without an Expression property. The AL0124 error 'The property Expression cannot be used in this context' indicates the model applied a property that doesn't exist for query column elements.

Correct Pattern:
query 70017 "CG Dimension Matrix"
{
    QueryType = Normal;

    elements
    {
        dataitem(DeptDimValue; "Dimension Value")
        {
            SqlJoinType = CrossJoin;
            DataItemTableFilter = "Dimension Code" = const('DEPARTMENT');

            column(DepartmentCode; "Code") { }
            column(DepartmentName; Name) { }

            dataitem(ProjDimValue; "Dimension Value")
            {
                SqlJoinType = CrossJoin;
                DataItemTableFilter = "Dimension Code" = const('PROJECT');

                column(ProjectCode; "Code") { }
                column(ProjectName; Name) { }

                dataitem(DimSetEntry; "Dimension Set Entry")
                {
                    SqlJoinType = LeftOuterJoin;
                    DataItemLink = "Dimension Code" = DeptDimValue."Dimension Code";

                    column(MatchCount; "Dimension Value Code")
                    {
                        Method = Count;
                    }
                }
            }
        }
    }
}
Incorrect Pattern:
column(DepartmentCode; ...) { Expression = ...; } // Lines 21 and 37 used Expression property

Error Codes: AL0124

25 codeunit-self-reference-fluent-api fluent-api-pattern 1 CG-AL-H018

Description: The model attempted to use 'CurrCodeunit' to return a self-reference from codeunit procedures for a fluent API pattern. 'CurrCodeunit' is not a valid keyword in AL. In AL, to implement a fluent API pattern where methods return the codeunit itself, you need to use a variable of the codeunit type and assign it via a parameter or use 'this' (in newer runtimes) or pass the codeunit instance as a VAR parameter. The correct approach is to declare a local or global variable of type Codeunit "CG Request Builder" and use the implicit 'this' reference, or more commonly, declare a global variable and assign it in each method. In modern AL (runtime 11.0+), you can use 'this' keyword. For older runtimes, a common pattern is to have each procedure take a VAR parameter of the codeunit type, or to store a reference. The simplest correct pattern is to declare a return variable and exit with it referencing the current instance.

Correct Pattern:
Use a local variable pattern or 'this' keyword (runtime 11.0+). For example:

procedure SetUrl(Url: Text): Codeunit "CG Request Builder"
begin
    RequestUrl := Url;
    exit(this);
end;

Or for older runtimes, declare a global variable 'Self: Codeunit "CG Request Builder"' and bind it appropriately, though the cleanest approach in modern AL is simply 'exit(this);'.
Incorrect Pattern:
exit(CurrCodeunit);

Error Codes: AL0118

26 runtime-version-api-availability-and-tryfunction-pattern recordref-fieldref-dynamic-operations 1 CG-AL-H022

Description: The model generated code with multiple issues: (1) It used TryFunction or similar pattern incorrectly, resulting in AL0122 'Cannot implicitly convert type None to Boolean' and AL0173 'Operator not cannot be applied to operand of type None' - likely trying to use the return value of a procedure that doesn't return a value as a boolean, or misusing [TryFunction] pattern. (2) It used RecordRef.FieldExist() and RecordRef.Field() methods which are only available in runtime version 16.0+, but the target environment uses runtime 15.0. For runtime 15.0, the model should have used a TryFunction wrapper or alternative approach to check field existence, and should have used FieldRef via FieldIndex iteration rather than direct Field() access. The model lacks knowledge of BC runtime version compatibility and proper error handling patterns for RecordRef operations in older runtimes.

Correct Pattern:
For runtime 15.0: Use [TryFunction] procedures that wrap RecordRef.FieldIndex or other available methods. Instead of RecordRef.FieldExist() (runtime 16.0+), use a TryFunction that attempts to access the field and catches errors. Instead of RecordRef.Field() (runtime 16.0+), iterate using FieldIndex. For TryFunction usage, declare as [TryFunction] local procedure TryGetField(var RecRef: RecordRef; FieldNo: Integer; var FldRef: FieldRef) and call with 'if TryGetField(RecRef, FieldNo, FldRef) then ...'
Incorrect Pattern:
RecordRef.FieldExist(FieldNo) and RecordRef.Field(FieldNo) calls, plus incorrect boolean conversion from TryFunction or void procedure

Error Codes: AL0666

27 page-field-source-expression page-field-definition 1 CG-AL-M004

Description: The model generated a page where fields reference names that don't exist in the current context. This is a classic AL error where page fields must use `field(FieldName; Rec."FieldName")` or `field(FieldName; "FieldName")` syntax to bind to the source table's fields. The AL0118 errors on 'No.', 'Sell-to Customer No.', 'Sell-to Customer Name', 'Order Date', 'Posting Date', 'Status', 'Amount', and 'Amount Including VAT' indicate the model likely used incorrect syntax for field declarations on the page, such as omitting the `field()` wrapper or using incorrect source expressions. The generated code was not captured but the compilation errors clearly show the model failed to properly define page fields bound to the Sales Header table.

Correct Pattern:
field("No."; Rec."No.") { ApplicationArea = All; }
field("Sell-to Customer No."; Rec."Sell-to Customer No.") { ApplicationArea = All; }
field("Sell-to Customer Name"; Rec."Sell-to Customer Name") { ApplicationArea = All; }
field("Order Date"; Rec."Order Date") { ApplicationArea = All; }
field("Posting Date"; Rec."Posting Date") { ApplicationArea = All; }
field(Status; Rec.Status) { ApplicationArea = All; }
field(Amount; Rec.Amount) { ApplicationArea = All; }
field("Amount Including VAT"; Rec."Amount Including VAT") { ApplicationArea = All; }
Incorrect Pattern:
// Exact generated code not available, but errors indicate fields were referenced incorrectly, e.g., possibly using bare field names without proper field() syntax or missing Rec. prefix in expressions

Error Codes: AL0118

28 event-subscriber-in-table-extension event-subscriber-placement 1 CG-AL-M006

Description: The model placed [EventSubscriber] attributes inside a table extension object. In AL, the EventSubscriber attribute can only be used within a Codeunit object. The model should have either placed the event subscriber procedures in a separate codeunit or avoided using EventSubscriber attributes in the table extension altogether. The task asked to 'include integration with existing Customer events' which the model attempted by adding EventSubscriber procedures directly in the table extension, which is not valid AL.

Correct Pattern:
EventSubscriber procedures must be placed in a separate codeunit object, not inside a table extension. For example:

codeunit 70002 "Customer Event Subscribers"
{
    [EventSubscriber(ObjectType::Table, Database::Customer, 'OnAfterValidateEvent', 'Credit Limit (LCY)', false, false)]
    local procedure OnAfterValidateCreditLimit(var Rec: Record Customer)
    begin
        // event handling logic
    end;
}
Incorrect Pattern:
// Inside tableextension 70001 ...
[EventSubscriber(...)]
local procedure OnAfter...()
begin
  ...
end;

Error Codes: AL0313

29 al-api-usage-telemetry-and-text-functions AL built-in functions and enums 1 CG-AL-M009

Description: The model generated code with multiple AL API usage errors: (1) Used 'GetChar' which doesn't exist in AL - likely confused with another language or meant to use array indexing on text. (2) Used 'Verbosity::Information' which is not a valid enum value in AL - the correct enum is 'Verbosity::Normal' or 'Verbosity::Verbose'. (3) Used 'TelemetryScope::Extension' which doesn't exist - the correct value is 'TelemetryScope::ExtensionPublisher'. These errors indicate the model lacks precise knowledge of AL's built-in enums and text manipulation functions.

Correct Pattern:
Use text indexing like MyText[i] instead of GetChar. Use Verbosity::Normal instead of Verbosity::Information. Use TelemetryScope::ExtensionPublisher instead of TelemetryScope::Extension.
Incorrect Pattern:
GetChar(...) / Verbosity::Information / TelemetryScope::Extension

Error Codes: AL0118

30 yaml-parsing-in-al text-parsing-and-json-manipulation 1 CG-AL-M021

Description: The model failed to generate any valid AL code for the YAML handler codeunit. The compilation error AL0111 (Semicolon expected) at line 95 indicates the model produced syntactically invalid AL code. The task requires implementing custom YAML parsing (splitting text by line feeds, splitting each line by colon to get key-value pairs) and converting between YAML text format and JsonObject. The model apparently struggled with generating a complete, syntactically correct codeunit that handles string parsing for a simple YAML format (key: value lines) and JsonObject manipulation. The 'Generated code not found' note and the compilation failure suggest the model either produced incomplete code or code with fundamental syntax errors.

Correct Pattern:
codeunit 70121 "CG YAML Handler"
{
    Access = Public;

    procedure ParseYamlConfig(YamlContent: Text): Text
    var
        JObj: JsonObject;
        Lines: List of [Text];
        Line: Text;
        Key: Text;
        Value: Text;
        ColonPos: Integer;
        NameVal: Text;
        VersionVal: Text;
        DebugVal: Text;
        PortVal: Text;
        JToken: JsonToken;
    begin
        // Parse YAML lines into JsonObject
        Lines := YamlContent.Split(GetLf());
        foreach Line in Lines do begin
            ColonPos := Line.IndexOf(':');
            if ColonPos > 0 then begin
                Key := Line.Substring(1, ColonPos - 1).Trim();
                Value := Line.Substring(ColonPos + 1).Trim();
                JObj.Add(Key, Value);
            end;
        end;
        // Extract values and format
        if JObj.Get('name', JToken) then NameVal := JToken.AsValue().AsText();
        if JObj.Get('version', JToken) then VersionVal := JToken.AsValue().AsText();
        if JObj.Get('debug', JToken) then DebugVal := JToken.AsValue().AsText();
        if JObj.Get('port', JToken) then PortVal := JToken.AsValue().AsText();
        exit(StrSubstNo('App: %1 v%2, Debug: %3, Port: %4', NameVal, VersionVal, DebugVal, PortVal));
    end;
    // ... other procedures similarly implemented
}
Incorrect Pattern:
// Generated code not found - model produced syntactically invalid AL code with semicolon error at line 95

Error Codes: AL0111

31 httprequestmessage-header-access http-client-usage 1 CG-AL-M022

Description: The model failed to generate any valid code (generated code not found), and when it did attempt generation, it tried to access 'Headers' property on HttpRequestMessage which doesn't exist in AL. In AL/Business Central, to set headers on an HTTP request, you need to use HttpHeaders type obtained via HttpContent.GetHeaders() or HttpRequestMessage.GetHeaders() methods, not a direct '.Headers' property. The model lacks knowledge of the correct AL HTTP client API patterns for setting headers and making HTTP requests.

Correct Pattern:
To set Content-Type header in AL, use HttpContent.GetHeaders(Headers) then Headers.Remove('Content-Type') and Headers.Add('Content-Type', 'application/json'). For request headers, use HttpRequestMessage.GetHeaders(Headers). Example:

var
  Client: HttpClient;
  RequestMsg: HttpRequestMessage;
  ResponseMsg: HttpResponseMessage;
  Content: HttpContent;
  Headers: HttpHeaders;
begin
  Content.WriteFrom(ReportJson);
  Content.GetHeaders(Headers);
  Headers.Remove('Content-Type');
  Headers.Add('Content-Type', 'application/json');
  RequestMsg.Method := 'POST';
  RequestMsg.SetRequestUri('https://api.weather.example/reports');
  RequestMsg.Content := Content;
  if Client.Send(RequestMsg, ResponseMsg) then
    exit(ResponseMsg.HttpStatusCode in [200, 201]);
  exit(false);
end;
Incorrect Pattern:
// The model's code accessed HttpRequestMessage.Headers which doesn't exist in AL

Error Codes: AL0132

32 page-extension-cardpageid-override page-extension-properties 1 CG-AL-E053

Description: The model failed to generate valid AL code for a page extension. The compilation errors indicate multiple syntax issues: at line 3 the model likely used an incorrect syntax for the CardPageId property override (a BC 2025 Wave 1 feature), and at line 12-13 the action definition used incorrect syntax (likely referencing a page by name instead of ID, and using RunPageLink incorrectly). The model appears to lack knowledge of the correct syntax for overriding CardPageId on a page extension and for properly defining actions with RunObject in page extensions.

Correct Pattern:
pageextension 70053 "CG Item List Extension" extends "Item List"
{
    CardPageId = "Item Card";

    actions
    {
        addlast(Processing)
        {
            action("Show Item Details")
            {
                ApplicationArea = All;
                Caption = 'Show Item Details';
                Image = Card;
                RunObject = page "Item Card";
                RunPageLink = "No." = field("No.");
            }
        }
    }
}
Incorrect Pattern:
Generated code not found - but errors suggest incorrect CardPageId syntax on line 3 and incorrect action/RunObject syntax on lines 12-13 with invalid RunPageLink usage

Error Codes: AL0104