← Back to Benchmark Results

openrouter/qwen/qwen3-max-thinking

57.1%
Pass Rate
32/56
Tasks Passed
3
Runs
51.2%
pass@1
57.1%
pass@3
87.5%
Consistency
0.1
Temperature
-
Thinking
403,539
Tokens
$3.70
Cost
1st: 522nd: 34Failed: 2432/56 passed

Known Shortcomings (27)

Sorted by occurrence count (most frequent first)

# Concept AL Concept Count Affected Tasks
1 option-field-optionmembers-required table-extension-field-properties 2 CG-AL-E006, CG-AL-M006

Description: The model generated a table extension with an Option field but left the OptionMembers property blank or omitted it entirely. In AL, when defining a field of type Option, the OptionMembers property must be explicitly set with at least one value (e.g., OptionMembers = Email,Phone,Mail,SMS). The compiler error AL0153 indicates 'The property OptionMembers cannot be blank'. The model failed to properly define the OptionMembers for the Preferred Contact Method field in the table extension.

Correct Pattern:
field(70000; "Preferred Contact Method"; Option)
{
    Caption = 'Preferred Contact Method';
    OptionMembers = Email,Phone,Mail,SMS;
    OptionCaption = 'Email,Phone,Mail,SMS';
}
Incorrect Pattern:
field(70000; "Preferred Contact Method"; Option)
{
    Caption = 'Preferred Contact Method';
    OptionMembers = ;
}

Error Codes: AL0153, AL0104

2 variant-type-argument-and-interface-definition interface-definition 2 CG-AL-H023, CG-AL-H015

Description: The model made multiple errors: (1) It tried to use 'Variant' as a type argument in a generic collection (e.g., Dictionary of [Text, Variant] or similar), but AL does not allow Variant as a type argument in generic types like Dictionary or List. (2) It failed to create the 'IFieldTransformer' interface as a separate AL interface object, instead likely trying to reference it as a Codeunit. In AL, interfaces are defined with 'interface "IFieldTransformer"' syntax and are distinct from codeunits. The TransformRecord procedure should accept a parameter implementing the interface, not a Codeunit type directly referencing the interface name as a codeunit.

Correct Pattern:
1) Avoid using Variant as a type argument - use Text or specific types instead. 2) Define a separate interface object: 'interface "IFieldTransformer" { procedure Transform(var FRef: FieldRef): Variant; }' and reference it in the procedure signature as 'Transformer: Interface "IFieldTransformer"' rather than 'Codeunit "IFieldTransformer"'.
Incorrect Pattern:
Lines using Variant as type argument (e.g., Dictionary of [Text, Variant]) and referencing 'Codeunit IFieldTransformer' instead of properly defining and using an interface

Error Codes: AL0408, AL0104

3 query-object-syntax query-definition 2 CG-AL-H011, CG-AL-H017

Description: The model failed to generate valid AL code for a query object. The compilation errors (AL0107 'identifier expected', AL0104 '=' expected at line 26:32, and AL0104 '}' expected at line 29:13) indicate the model produced syntactically invalid AL code for the query object definition. The generated code likely had issues with the query column/filter syntax, possibly around the ColumnFilter = const(Order) declaration or the Method = Sum/Count aggregate column definitions. The model does not appear to have sufficient knowledge of AL query object syntax including dataitem definitions, column definitions with aggregation methods, and filter elements.

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 - but errors at line 26:32 suggest incorrect syntax around filter or column definitions in the query object

Error Codes: AL0107, AL0104

4 enum-frominteger-syntax enum-handling 1 CG-AL-H007

Description: The model failed to generate valid code entirely (generated code not found / compilation failed). The AL0151 error 'Expression must be an Option' at line 18:22 indicates the model likely used Enum.FromInteger() or similar enum conversion incorrectly, or passed an enum value where an Option was expected. The model did not understand how to properly work with ErrorInfo.CustomDimensions and enum integer conversion in modern AL. The task requires using Format() to convert enum ordinal to text for CustomDimensions, and Enum::"CG Validation Error".FromInteger() to convert back, along with ErrorInfo.Create() pattern. The model either failed to produce code at all or produced code with fundamental enum/ErrorInfo handling errors.

Correct Pattern:
To convert enum to integer for CustomDimensions: Format(ErrorCode.AsInteger()). To convert back: Enum::"CG Validation Error".FromInteger(IntValue). ErrorInfo should be created via ErrorInfo.Create() and properties set individually: ErrInfo.Message(ErrorMessage); ErrInfo.CustomDimensions.Add('ErrorCode', Format(ErrorCode.AsInteger())); ErrInfo.CustomDimensions.Add('FieldName', FieldName); ErrInfo.Collectible(IsCollectingErrors());
Incorrect Pattern:
// Generated code not found - but error at line 18:22 suggests incorrect enum usage, likely passing an Enum where an Option/Integer was expected

Error Codes: AL0151

5 list-iteration-pattern list-of-type-operations 1 CG-AL-M002

Description: The model attempted to use a 'Sum' method on 'List of [Decimal]' which does not exist in AL. In AL, the List type does not have a Sum() method. To sum elements of a List of [Decimal], you must iterate through the list using a foreach loop or index-based for loop and accumulate the total manually. The model failed to generate valid code for the CalculateOrderTotal procedure, using a non-existent .Sum method instead of iterating over the list.

Correct Pattern:
procedure CalculateOrderTotal(LineTotals: List of [Decimal]): Decimal
var
    LineTotal: Decimal;
    Total: Decimal;
begin
    Total := 0;
    foreach LineTotal in LineTotals do
        Total += LineTotal;
    exit(Total);
end;
Incorrect Pattern:
LineTotals.Sum

Error Codes: AL0132

6 json-object-api-methods json-handling 1 CG-AL-M005

Description: The model generated code using incorrect AL JSON API methods. Multiple errors show fundamental misunderstanding of the AL JSON types: (1) JsonObject doesn't have a 'Clear' method - should use Clear(variable) built-in or reinitialize, (2) 'JSON Management' codeunit doesn't have 'TryGetObject' method, (3) JsonToken doesn't have 'IsText' or 'AsText' methods - should use Token.IsValue() and Token.AsValue().AsText(), (4) JsonObject doesn't have a 'Count' method - should use Keys.Count or similar pattern. The model confused AL's native JSON types (JsonObject, JsonToken, JsonValue) API with other frameworks or older BC JSON patterns.

Correct Pattern:
Use Clear(JsonObjectVar) for clearing, JsonObject.Get('key', Token) for retrieval, Token.IsValue() and Token.AsValue().AsText() for type checking and value extraction, and JsonObject.Keys.Count for counting properties. Use JsonObject.Contains('key') to check field existence.
Incorrect Pattern:
JsonObject.Clear(); JSONManagement.TryGetObject(); JsonToken.IsText(); JsonToken.AsText(); JsonObject.Count()

Error Codes: AL0132

7 bc-event-names-and-table-references event-subscribers-and-bc-object-model 1 CG-AL-M008

Description: The model generated code with multiple fundamental errors about the BC object model: (1) It referenced non-existent events 'OnAfterInsert' and 'OnAfterModify' on the Purchase Header table - the correct integration events have different names (e.g., 'OnAfterInsertEvent' or the model should use different event patterns). (2) It referenced non-existent tables 'Workflow Setup' and 'Workflow Comment Line' - these are not standard BC tables. (3) It referenced a non-existent codeunit 'SMTP Mail' which was deprecated/removed in modern BC versions. The model lacks knowledge of the actual BC event naming conventions, the correct BC workflow-related table names, and the current email API in Business Central.

Correct Pattern:
For a self-contained implementation: avoid subscribing to non-existent events, use in-memory tracking (Dictionary or temporary records) instead of referencing non-existent tables like 'Workflow Setup' and 'Workflow Comment Line', and use the modern Email module (Codeunit "Email Message"/"Email") instead of the deprecated 'SMTP Mail'. For event subscribers on Purchase Header, use actual published events like 'OnAfterValidateEvent' or integration events that actually exist on the table.
Incorrect Pattern:
EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterInsert', ...)
EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterModify', ...)
Table 'Workflow Setup'
Table 'Workflow Comment Line'
Codeunit 'SMTP Mail'

Error Codes: AL0280

8 report-dataitem-trigger-syntax report-definition 1 CG-AL-M007

Description: The model generated a report with multiple syntax errors including incorrect brace placement in dataitem definitions, and used 'OnPostDataItem' which is not a valid trigger in AL reports. The valid triggers for report dataitems are OnPreDataItem, OnAfterGetRecord, and OnPostDataItem is not recognized. The compilation errors (AL0104 for missing '}' and AL0162 for invalid trigger) indicate the model does not properly understand AL report structure with nested dataitems, proper trigger names, and correct brace/block scoping. The model also likely had structural issues with how dataitem blocks are nested and closed, leading to cascading syntax errors.

Correct Pattern:
report 70001 "Sales Performance Analysis"
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    DefaultRenderingLayout = RDLCLayout;

    dataset
    {
        dataitem(Customer; Customer)
        {
            RequestFilterFields = "No.", "Customer Posting Group";
            column(CustomerNo; "No.") { }
            column(CustomerName; Name) { }

            trigger OnPreDataItem()
            begin
                // initialization
            end;

            trigger OnAfterGetRecord()
            begin
                // calculations
            end;

            dataitem(SalesHeader; "Sales Header")
            {
                DataItemLink = "Sell-to Customer No." = field("No.");
                DataItemTableView = where("Document Type" = const(Order));

                dataitem(SalesLine; "Sales Line")
                {
                    DataItemLink = "Document No." = field("No."), "Document Type" = field("Document Type");

                    trigger OnAfterGetRecord()
                    begin
                        // line calculations
                    end;
                }
            }
        }
    }

    requestpage
    {
        layout
        {
            area(Content)
            {
                group(Options)
                {
                    // filter fields
                }
            }
        }
    }

    rendering
    {
        layout(RDLCLayout)
        {
            Type = RDLC;
            LayoutFile = 'SalesPerformanceAnalysis.rdl';
        }
    }
}
Incorrect Pattern:
Generated code not available but errors indicate: mismatched braces at lines 43, 76, 113; use of 'OnPostDataItem' trigger at line 113; and structural collapse at line 120

Error Codes: AL0104

9 jsonobject-get-selecttoken-pattern json-api-usage 1 CG-AL-M020

Description: The model incorrectly used JsonObject.Get() by passing typed variables (Text, Decimal, Boolean, Integer, JsonArray) directly as the second argument, but JsonObject.Get() returns a JsonToken via a 'var JsonToken' parameter. The model also tried to use non-existent methods like JsonToken.IsInteger() and JsonToken.AsInteger(). The correct pattern is to first get a JsonToken, then convert it to a JsonValue, and use AsText(), AsDecimal(), AsBoolean(), AsInteger() on the JsonValue. For arrays, you get the JsonToken and then use AsArray().

Correct Pattern:
var JToken: JsonToken; JValue: JsonValue;
ProductJson.Get('name', JToken);
JValue := JToken.AsValue();
NameValue := JValue.AsText();
// For arrays:
ProductJson.Get('values', JToken);
ValuesArray := JToken.AsArray();
// For array elements:
ValuesArray.Get(i, JToken);
JValue := JToken.AsValue();
IntVal := JValue.AsInteger();
Incorrect Pattern:
ProductJson.Get('name', NameValue); // where NameValue is Text
ProductJson.Get('price', PriceValue); // where PriceValue is Decimal
JsonToken.IsInteger()
JsonToken.AsInteger()

Error Codes: AL0133

10 flowfield-calcformula-syntax flowfield 1 CG-AL-M010

Description: The model generated a FlowField (likely for 'Actual Cost') with an incorrect CalcFormula syntax. The AL compiler error AL0176 at line 125 indicates that the model used an invalid calculation formula method. In AL, CalcFormula must use one of the recognized methods: Average, Count, Exist, Min, Max, Lookup, or Sum. The model likely wrote something syntactically invalid such as a malformed Sum expression or used an unsupported method/syntax in the CalcFormula property. Additionally, the task asked for 'Actual Cost' to be 'calculated from tasks', which should use a FlowField with CalcFormula = Sum("Project Task"."some field" WHERE("Project Code" = FIELD("Project Code"))), but the model got the syntax wrong.

Correct Pattern:
field(6; "Actual Cost"; Decimal)
{
    FieldClass = FlowField;
    CalcFormula = Sum("Project Task"."Actual Hours" WHERE("Project Code" = FIELD("Project Code")));
    // Or alternatively sum of (Actual Hours * Hourly Rate) but that requires an intermediate field
}
Incorrect Pattern:
The generated code at line 125 contained an invalid CalcFormula expression that did not use one of the recognized formula methods (Average, Count, Exist, Min, Max, Lookup, Sum)

Error Codes: AL0176

11 yaml-parsing-variable-naming-and-syntax al-syntax-reserved-words-and-json-iteration 1 CG-AL-M021

Description: The model generated AL code with multiple syntax errors. The primary issue at line 84 is using 'Key' as a variable name or in an invalid context - 'Key' may be treated as a reserved word or the model used incorrect syntax for iterating over JsonObject keys. Additional errors suggest malformed expressions and mismatched parentheses/blocks. The model failed to properly implement YAML parsing (which requires manual string splitting in AL since there's no native YAML library) and JSON object iteration patterns. The model likely tried to use foreach-style iteration over JsonObject keys using incorrect syntax, and may have used reserved words as variable identifiers without proper quoting.

Correct Pattern:
In AL, to iterate over JsonObject members, use JsonObject.Keys() which returns a List of Text. Declare a variable like 'KeyName: Text' (avoiding reserved words), get keys via JObj.Keys, then use foreach KeyName in KeysList. For YAML parsing, manually split text by line feed characters and parse 'key: value' pairs using StrPos/CopyStr or TextSplit. Example: KeysList := JObj.Keys; foreach KeyName in KeysList do begin JObj.Get(KeyName, JToken); ... end;
Incorrect Pattern:
Key (line 84 context - likely something like 'foreach Key in JsonObj.Keys do' or similar invalid pattern)

Error Codes: AL0519

12 temporary-table-parameter-handling temporary-table 1 CG-AL-H003

Description: The test TestHighInventoryDiscount fails because the model's generated code does not correctly populate the TempResult temporary record with items that have inventory >= 100. The test finds an Item with Inventory >= 100 and Unit Price > 0, then calls ProcessItemsWithDiscount with MinDiscount=15, and expects to find that item in TempResult with Discount Percent = 15. The failure 'Assert.IsTrue failed. High inventory item should be in results' indicates the item was not inserted into TempResult. This is likely because the model's implementation has a bug in how it loops through items, assigns line numbers, calculates discounts, or inserts records into the temporary table. Since the generated code was not captured ('Generated code not found'), but the app compiled and other tests passed (only TestHighInventoryDiscount failed), the model likely had an issue with the discount tier logic (e.g., using wrong comparison operators like '>' instead of '>=' for the inventory thresholds), causing items with exactly 100 inventory to get 10% instead of 15%, thus being excluded when MinDiscount=15.

Correct Pattern:
if Item.Inventory >= 100 then
    DiscountPercent := 15
else if Item.Inventory >= 50 then
    DiscountPercent := 10
else if Item.Inventory >= 10 then
    DiscountPercent := 5
else
    DiscountPercent := 0;

Note: Must use >= (greater than or equal) not > (greater than) for inventory thresholds.
Incorrect Pattern:
// Generated code not found - but the compiled app had a logic error in discount tier calculation
13 word-counting-with-extra-spaces string-manipulation 1 CG-AL-E005

Description: The model's CountWords implementation does not correctly handle extra/leading/trailing spaces. The test 'TestCountWordsExtraSpaces' passes ' hello world ' and expects 2 words, but the model's implementation returned 8, indicating it likely counted individual characters or spaces rather than properly splitting by whitespace and ignoring empty segments. A correct implementation needs to iterate through the string, tracking transitions from space to non-space characters (or splitting and filtering empty entries).

Correct Pattern:
procedure CountWords(InputText: Text): Integer
var
    i: Integer;
    WordCount: Integer;
    InWord: Boolean;
begin
    if InputText = '' then
        exit(0);
    InWord := false;
    WordCount := 0;
    for i := 1 to StrLen(InputText) do begin
        if InputText[i] <> ' ' then begin
            if not InWord then begin
                WordCount += 1;
                InWord := true;
            end;
        end else
            InWord := false;
    end;
    exit(WordCount);
end;
Incorrect Pattern:
// Generated code not available, but the CountWords procedure returned 8 for input '  hello   world  ' instead of 2
14 xmlport-format-textencoding xmlport-properties 1 CG-AL-E009

Description: The model generated an XMLport with a 'TextEncoding' property while the 'Format' property was either not set or set to 'Xml'. The AL compiler error AL0167 states that 'TextEncoding' can only be used when 'Format' is set to 'VariableText' or 'FixedText'. For an XML export XMLport, the Format defaults to 'Xml' and TextEncoding should not be specified. The model lacks understanding of which XMLport properties are compatible with each other.

Correct Pattern:
xmlport 70000 "Item Export"
{
    Direction = Export;
    Format = Xml;
    // Do NOT include TextEncoding when Format is Xml

    schema
    {
        textelement(Items)
        {
            tableelement(Item; Item)
            {
                fieldelement(No; Item."No.") { }
                fieldelement(Description; Item.Description) { }
                fieldelement(UnitPrice; Item."Unit Price") { }
                fieldelement(Inventory; Item.Inventory) { }
            }
        }
    }
}
Incorrect Pattern:
The generated code included a TextEncoding property on an XMLport with Format=Xml (or default format), e.g.:
TextEncoding = UTF8;
without setting Format to VariableText or FixedText.

Error Codes: AL0167

15 multiline-string-literals string-literals 1 CG-AL-E050

Description: The model attempted to use multiline string literals in AL but produced improperly terminated text literals (AL0360). AL does not support traditional multiline string literals like other languages. The model likely tried to embed actual newlines inside a single-quoted string literal, which is not valid AL syntax. In AL, multiline text must be constructed either using string concatenation with CR/LF characters (e.g., using TypeHelper or explicit char values), or by using the newer AL multiline string literal syntax (triple single quotes '''...''') available in newer BC versions. The model failed to use the correct syntax for producing multiline text content.

Correct Pattern:
Use either string concatenation with newline characters: exit('SELECT CustomerNo, Name, Balance' + Environment.NewLine() + 'FROM Customer' + ...); or use AL's triple-quote multiline string syntax if supported by the target runtime version.
Incorrect Pattern:
Text literal spanning multiple lines without proper termination around line 7-10 of the generated file

Error Codes: AL0360

16 errorinfo-customdimensions-api errorinfo-handling 1 CG-AL-H007

Description: The model generated incorrect code for setting CustomDimensions on an ErrorInfo object. The compilation errors at line 16 suggest the model likely used an incorrect method signature for adding custom dimensions, such as calling CustomDimensions.Add() with wrong parameter types or using an incorrect pattern to build the ErrorInfo. The errors 'cannot convert from Text to Boolean' and 'cannot convert from Text to var Table' indicate the model confused the ErrorInfo API - possibly passing text arguments where the API expects different types, or misusing a method like ErrorInfo.AddNavigationAction or similar. The correct pattern involves using a Dictionary of [Text, Text] and assigning it to ErrorInfo.CustomDimensions.

Correct Pattern:
var
    ErrInfo: ErrorInfo;
    CustomDims: Dictionary of [Text, Text];
begin
    ErrInfo.Message(ErrorMessage);
    CustomDims.Add('ErrorCode', Format(ErrorCode.AsInteger()));
    CustomDims.Add('FieldName', FieldName);
    ErrInfo.CustomDimensions(CustomDims);
    ErrInfo.Collectible(IsCollectingErrors());
    exit(ErrInfo);
Incorrect Pattern:
Unable to see exact generated code, but line 16 has arguments of type Text being passed where Boolean and Table are expected, suggesting incorrect ErrorInfo.CustomDimensions usage

Error Codes: AL0133

17 jsonobject-typed-getter-methods json-api-patterns 1 CG-AL-H014

Description: The model incorrectly used JsonObject typed getter methods like GetText, GetInteger, GetBoolean, and GetArray. In AL, these methods follow the TryGet pattern where the second parameter is a 'var' output parameter and the method returns a Boolean indicating success. For example, JsonObject.Get('name', JToken) returns Boolean, and JsonValue.AsText() extracts the value. The model instead tried to pass the destination variable directly as the second argument expecting it to work like a simple getter, causing type conversion errors (e.g., 'cannot convert from Text to Boolean'). The task description mentions 'typed JSON getter methods' like GetText('name'), GetInteger('age'), etc., which don't exist as described in AL's JsonObject API. However, the model should have known the correct AL JSON API patterns and used the proper Get/SelectToken approach with JsonToken/JsonValue conversions.

Correct Pattern:
Use JsonObject.Get('name', JToken); JValue := JToken.AsValue(); NameText := JValue.AsText(); -- or use SelectToken. For arrays: JsonObject.Get('items', JToken); ItemsArray := JToken.AsArray(); For safe defaults: if not Obj.Get(Key, JToken) then exit(DefaultValue); exit(JToken.AsValue().AsText());
Incorrect Pattern:
JsonObject.GetText('name', NameVar) / JsonObject.GetInteger('age', AgeVar) / JsonObject.GetBoolean('active') / JsonObject.GetArray('items', ItemsArray)

Error Codes: AL0133

18 dictionary-iteration-syntax collections-dictionary-keys 1 CG-AL-H020

Description: The model used 'Key' as a variable name or keyword incorrectly when iterating over Dictionary keys. In AL, 'Key' is a reserved word in certain contexts. The model likely wrote something like 'foreach Key in Dict.Keys do' or declared a variable named 'Key' in a way that conflicts with AL syntax rules. The correct approach is to use Dict.Keys() method and iterate with a properly named variable (e.g., 'DictKey' or 'K'), avoiding the reserved word 'Key'. The errors appear at lines 55 and 99, which correspond to the MergeDictionaries and GetKeys procedures where dictionary key iteration is needed.

Correct Pattern:
Use a non-reserved variable name like 'DictKey' or 'K' when iterating dictionary keys. For example: 'foreach DictKey in Dict.Keys do' with 'DictKey: Text;' declared in the var section.
Incorrect Pattern:
Key: Text; (or similar usage of 'Key' as variable name in dictionary iteration context)

Error Codes: AL0519

19 tryfunction-boolean-return-pattern recordref-error-handling 1 CG-AL-H022

Description: The model generated code that uses 'not' operator on the return value of RecordRef.Open() or similar methods that return 'None' (void). In AL, RecordRef.Open() is a void procedure - it doesn't return a Boolean. To handle errors from such calls, the model should use [TryFunction] attribute on a helper procedure, or wrap the call in a procedure marked with [TryFunction] and check the Boolean return. The compilation errors at lines 9, 19, and 88 all show 'Operator not cannot be applied to an operand of type None', indicating the model tried patterns like 'if not RecRef.Open(TableId) then' instead of using TryFunction-based error handling (e.g., defining a local [TryFunction] procedure that calls RecRef.Open and then checking its Boolean return).

Correct Pattern:
[TryFunction] local procedure TryOpenTable(var RecRef: RecordRef; TableId: Integer)
begin
    RecRef.Open(TableId);
end;

procedure GetTableName(TableId: Integer): Text
var
    RecRef: RecordRef;
    TableName: Text;
begin
    if not TryOpenTable(RecRef, TableId) then
        exit('');
    TableName := RecRef.Name;
    RecRef.Close();
    exit(TableName);
end;
Incorrect Pattern:
if not RecRef.Open(TableId) then exit('');

Error Codes: AL0173

20 option-field-optionmembers-required table-extension-field-definition 1 CG-AL-M006

Description: The model generated a table extension with an Option field ('Risk Level') but left the OptionMembers property blank or omitted it entirely. In AL, Option fields require the OptionMembers property to have at least one value defined. The error AL0153 explicitly states 'The property OptionMembers cannot be blank'. The model needed to define OptionMembers = Low,Medium,High,Critical for the Risk Level field. Additionally, the generated code appears to be incomplete or malformed, as the compilation also reports 'App generation failed'.

Correct Pattern:
field(50002; "Risk Level"; Option)
{
    Caption = 'Risk Level';
    OptionMembers = Low,Medium,High,Critical;
    OptionCaption = 'Low,Medium,High,Critical';
    DataClassification = CustomerContent;
}
Incorrect Pattern:
field(50002; "Risk Level"; Option)
{
    OptionMembers = ;
    // or OptionMembers was omitted
}

Error Codes: AL0153

21 al-string-comparison-functions built-in-functions 1 CG-AL-M009

Description: The model used 'StrComp' which does not exist in AL/Business Central. AL does not have a StrComp function. For string comparison, the model should use standard AL comparison operators (=, <>, etc.) or built-in text methods like UpperCase/LowerCase for case-insensitive comparison. The model likely confused AL with another language (e.g., VBA or C) that has a StrComp function.

Correct Pattern:
Use standard AL string comparison operators (e.g., if FromCountry = ToCountry then ...) or use UpperCase/LowerCase for case-insensitive comparisons. For example: if UpperCase(FromCountry) = UpperCase(ToCountry) then ...
Incorrect Pattern:
StrComp(...)

Error Codes: AL0118

22 json-token-iteration-syntax json-object-key-enumeration 1 CG-AL-M021

Description: The model attempted to use 'Key' as a variable or keyword in a context where it is not valid AL syntax. In AL, when iterating over JsonObject keys, you must use the JsonObject.Keys property which returns a List of Text, and then iterate using foreach. The model likely wrote something like 'Key := ...' or used 'Key' as a reserved word incorrectly at lines 64, 85, and 121. The correct pattern is to declare a Text variable (e.g., KeyName) and use 'foreach KeyName in JsonObj.Keys do' or use JsonObj.Keys.Get(Index, KeyName) to enumerate keys. The model doesn't understand the proper AL syntax for iterating over JsonObject members.

Correct Pattern:
Declare a Text variable (e.g., KeyText: Text;) and use 'foreach KeyText in JsonObj.Keys do begin ... end;' or use JsonObj.Keys.Get(i, KeyText) to iterate over JsonObject keys.
Incorrect Pattern:
Key (used as identifier/keyword at lines 64, 85, 121 - likely something like 'Key := ...' or 'for Key in ...')

Error Codes: AL0519

23 json-value-to-decimal-conversion json-parsing 1 CG-AL-M022

Description: The model generated code that attempts to pass a JsonValue directly where a Text or Decimal is expected, likely doing something like `JsonToken.AsValue()` passed directly to a function or assignment without calling `.AsDecimal()` or `.AsText()` on the JsonValue. The AL0133 error 'cannot convert from JsonValue to Text' at line 27:38 indicates the model did not properly extract the typed value from a JsonValue object. In AL, when parsing JSON, you must call specific conversion methods like AsDecimal(), AsText(), AsInteger() etc. on JsonValue to get the underlying typed value.

Correct Pattern:
JsonToken.AsValue().AsDecimal() for Decimal values, or JsonToken.AsValue().AsText() for Text values. For example:

if JsonObject.Get('temperature', JsonToken) then
    Temperature := JsonToken.AsValue().AsDecimal();
Incorrect Pattern:
// Likely something like: Temperature := JsonToken.AsValue(); or similar pattern where JsonValue is not converted to the target type

Error Codes: AL0133

24 code-type-string-methods al-data-types 1 CG-AL-H001

Description: The model attempted to use '.ToUpper' on a Code[2] variable, which is not valid in AL. Code data types in AL are already case-insensitive and automatically stored in uppercase, so there is no ToUpper method available. The model should have compared the CountryCode directly (e.g., using a case statement or if/else) without calling ToUpper, since Code values are inherently uppercase in AL.

Correct Pattern:
Use the Code[2] parameter directly in comparisons (e.g., case CountryCode of 'US': ... 'DE': ... 'UK': ... end;) since Code types are automatically uppercase in AL.
Incorrect Pattern:
CountryCode.ToUpper()

Error Codes: AL0132

25 strpos-function-signature built-in-string-functions 1 CG-AL-E005

Description: The model generated code that calls StrPos with 3 arguments, but the AL built-in StrPos function only accepts 2 arguments: StrPos(String: Text, SubString: Text): Integer. The model likely confused it with a different language's string search function that accepts a start position parameter. The generated code was not captured in the output but the compilation error clearly shows the model wrote something like StrPos(InputText, ' ', StartPos) instead of using the correct 2-argument signature. For finding substrings from a specific position, the model should have used CopyStr to get a substring first, then called StrPos on that substring, or used a different approach entirely.

Correct Pattern:
StrPos(InputText, ' ') — StrPos only takes 2 arguments (the text to search in and the substring to find). To search from a specific position, use CopyStr to extract a substring first, then call StrPos on that substring.
Incorrect Pattern:
StrPos(InputText, ' ', SomeThirdArgument)

Error Codes: AL0126

26 string-numeric-extraction-and-replacement string-operations 1 CG-AL-E051

Description: The model generated code that incorrectly identifies and increments the numeric portion of a string. The test error shows that 'DOC-001' incremented by 1 produces 'DOC-200' instead of 'DOC-002'. This indicates the model's implementation is incorrectly parsing the numeric portion from the string - likely treating each digit independently or misidentifying which characters form the numeric suffix. The correct approach is to find the trailing numeric portion of the string, parse it as an integer, increment it, then format it back with the same zero-padding (same number of digits) and concatenate with the prefix. The model failed to correctly implement this pattern of extracting the rightmost contiguous numeric substring, performing arithmetic on it, and reinserting it with preserved width/padding.

Correct Pattern:
procedure IncrementByStep(Value: Text; Step: Integer): Text
var
    NumStart, NumEnd, NumLen, NumVal: Integer;
    NumStr, Prefix: Text;
begin
    NumEnd := StrLen(Value);
    while (NumEnd > 0) and (Value[NumEnd] >= '0') and (Value[NumEnd] <= '9') do
        NumEnd -= 1;
    NumStart := NumEnd + 1;
    NumLen := StrLen(Value) - NumEnd;
    Prefix := CopyStr(Value, 1, NumEnd);
    NumStr := CopyStr(Value, NumStart);
    Evaluate(NumVal, NumStr);
    NumVal += Step;
    exit(Prefix + PadStr('', NumLen - StrLen(Format(NumVal)), '0') + Format(NumVal));
end;
Incorrect Pattern:
// Generated code not found - but based on error output, the model produced code that transforms 'DOC-001' + step 1 into 'DOC-200' instead of 'DOC-002'
27 parse-failure unknown 1 CG-AL-M002

Description: Failed to parse LLM analysis response: Looking at this failure, the test `TestCalculateLineTotalZeroQuantity` expects that calling `CalculateLineTotal(0, 100.00)` returns 0 (zero). However, the generated code raises an error "Quantity must

Correct Pattern:
Incorrect Pattern: