← Back to Benchmark Results

openrouter/deepseek/deepseek-v3.2

Pass Rate:42.9%
Tasks Passed:24/56
Total Shortcomings:15

All Known Shortcomings

Sorted by occurrence count (most frequent first)

# Concept AL Concept Count Affected Tasks
1 char-type-not-available al-type-system 1 CG-AL-E005

Description: The model attempted to use 'Char' type and 'ToCharArray' method which do not exist in AL. In AL/Business Central, there is no 'Char' type like in C#. Text manipulation must be done using Text functions like CopyStr, StrLen, UpperCase, etc. The model incorrectly assumed C#-style string/character handling would work in AL.

Correct Pattern:
For capitalizing first letter in AL, use: UpperCase(CopyStr(InputText, 1, 1)) + CopyStr(InputText, 2). AL uses Text manipulation functions rather than character arrays.
Incorrect Pattern:
Char (used on line 29) and Text.ToCharArray (used on line 31)

Error Codes: AL0118

2 page-extension-field-properties page-extension-definition 1 CG-AL-E006

Description: The model generated a page extension with ApplicationArea property placed incorrectly. In AL page extensions, when adding fields to an existing group using 'addlast' or similar anchors, the ApplicationArea property cannot be applied directly to individual field controls in certain contexts. The model likely placed ApplicationArea inside field definitions within the page extension layout section where it's not valid. For page extensions extending standard BC pages, the ApplicationArea is typically inherited or must be set at a different level.

Correct Pattern:
In page extensions for BC standard pages like Customer Card (page 21), fields added should either inherit ApplicationArea from the page or use a different approach. The correct pattern is:

field("Preferred Contact Method"; Rec."Preferred Contact Method")
{
    Caption = 'Preferred Contact Method';
    ToolTip = 'Specifies the preferred contact method.';
}

Alternatively, ensure the page extension itself has proper ApplicationArea handling at the page level, not individual field level within addlast/addfirst blocks.
Incorrect Pattern:
field("Preferred Contact Method"; Rec."Preferred Contact Method")
{
    ApplicationArea = All;
    ...
}

Error Codes: AL0124

3 event-subscriber-attribute-syntax event-subscriber-definition 1 CG-AL-E010

Description: The model generated code with incorrect EventSubscriber attribute syntax. The AL0133 error at position 42:146 indicates the model passed a Text value where a 'Dictionary of [Text, Text]' was expected. This is the 6th argument of the EventSubscriber attribute, which should be empty or a proper dictionary for event parameters. The model likely used an older or incorrect syntax pattern for the EventSubscriber attribute.

Correct Pattern:
[EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterInsertEvent', '', false, false)]
local procedure OnAfterInsertItem(var Rec: Record Item; RunTrigger: Boolean)
begin
    // Event handler code
end;
Incorrect Pattern:
Unable to see exact generated code, but based on error at line 42 position 146, the EventSubscriber attribute has incorrect 6th parameter - likely passed a Text string instead of empty or Dictionary

Error Codes: AL0133

4 errorinfo-customdimensions-api ErrorInfo-handling 1 CG-AL-H007

Description: The model used incorrect method names for working with ErrorInfo.CustomDimensions. In AL, the ErrorInfo type uses 'CustomDimensions' as a Dictionary property that you access directly, not through 'AddCustomDimension' or 'GetCustomDimension' methods. The correct pattern is to use ErrorInfo.CustomDimensions.Add() and ErrorInfo.CustomDimensions.Get() since CustomDimensions is a Dictionary[Text, Text]. Additionally, the model incorrectly tried to call FromInteger() on an enum instance instead of the enum type.

Correct Pattern:
ErrInfo.CustomDimensions.Add('ErrorCode', Format(ErrorCode.AsInteger()));
ErrInfo.CustomDimensions.Add('FieldName', FieldName);
...
var ErrorCodeText: Text;
ErrInfo.CustomDimensions.Get('ErrorCode', ErrorCodeText);
...
Enum::"CG Validation Error".FromInteger(IntValue)
Incorrect Pattern:
ErrInfo.AddCustomDimension('ErrorCode', Format(ErrorCode.AsInteger()));
ErrInfo.AddCustomDimension('FieldName', FieldName);
...
ErrInfo.GetCustomDimension('ErrorCode')

Error Codes: AL0132

5 json-asvalue-method-signature json-api-methods 1 CG-AL-H014

Description: The model generated code that incorrectly uses the AsValue().AsText() pattern with a default value parameter. In AL, the JsonValue.AsText() method does not accept a default value parameter. The error 'cannot convert from Text to Boolean' at line 40:39 indicates the model likely wrote something like 'JsonToken.AsValue().AsText(Key, DefaultValue)' where the second parameter is being interpreted incorrectly. The correct pattern for SafeGetText with a default value requires checking if the key exists first using SelectToken() or Get() and then providing the default manually.

Correct Pattern:
procedure SafeGetText(Obj: JsonObject; Key: Text; DefaultValue: Text): Text
var
    JToken: JsonToken;
begin
    if Obj.Get(Key, JToken) then
        exit(JToken.AsValue().AsText())
    else
        exit(DefaultValue);
end;
Incorrect Pattern:
// Line 40 likely contains something like: exit(Obj.AsValue().AsText(Key, DefaultValue)); // or similar incorrect usage where Text is passed where Boolean expected

Error Codes: AL0133

6 fluent-api-self-reference codeunit-self-reference 1 CG-AL-H018

Description: The model attempted to use 'Self' keyword to return the current codeunit instance for fluent API chaining, but 'Self' does not exist in AL. In AL, to implement a fluent API pattern where methods return the current codeunit instance, you must use the 'this' keyword or pass the codeunit as a VAR parameter. The model lacks knowledge of how to properly implement fluent/builder patterns in AL.

Correct Pattern:
In AL, to return the current codeunit instance for fluent chaining, you should declare a local variable of the codeunit type, assign 'this' to it (or use Codeunit.Run pattern), and return that. Example:

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

Alternatively, since codeunits are reference types in newer AL versions, you can simply use 'exit(this);' to return the current instance.
Incorrect Pattern:
exit(Self);

Error Codes: AL0118

7 list-dictionary-collection-types collection-types 1 CG-AL-H020

Description: The model failed to generate any code for this task. The compilation error 'List of [Text]' does not contain a definition for 'List' at line 89:44 indicates the model attempted to access a 'List' property on a List type, which doesn't exist. The model doesn't understand how to properly work with AL's List and Dictionary generic collection types, including iteration patterns, modification in place, and nested generic types like Dictionary of [Text, List of [Text]].

Correct Pattern:
codeunit 70020 "CG Collection Processor"
{
    procedure JoinTexts(Items: List of [Text]; Separator: Text): Text
    var
        Result: Text;
        Item: Text;
        IsFirst: Boolean;
    begin
        IsFirst := true;
        foreach Item in Items do begin
            if not IsFirst then
                Result += Separator;
            Result += Item;
            IsFirst := false;
        end;
        exit(Result);
    end;

    procedure FilterByPrefix(Items: List of [Text]; Prefix: Text): List of [Text]
    var
        Result: List of [Text];
        Item: Text;
    begin
        foreach Item in Items do
            if Item.StartsWith(Prefix) then
                Result.Add(Item);
        exit(Result);
    end;

    // ... other procedures using foreach and proper collection methods
}
Incorrect Pattern:
// Generated code not found - model failed to produce valid AL code for collection operations

Error Codes: AL0132

8 recordref-open-error-handling recordref-operations 1 CG-AL-H022

Description: The model generated code that attempts to use the 'not' operator on the result of RecordRef.Open(), but RecordRef.Open() is a procedure that returns nothing (None/void). The model incorrectly assumed RecordRef.Open() returns a Boolean indicating success/failure. In AL, RecordRef.Open() throws an error if the table cannot be opened - it doesn't return a Boolean. To handle invalid table IDs, you must use TryFunction pattern or check if the table exists before opening.

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

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

Error Codes: AL0173

9 code-generation-failure complete-code-generation 1 CG-AL-H023

Description: The model failed to generate any code at all. The compilation error AL0107 'Syntax error, identifier expected' at line 306:75 indicates the model produced incomplete or malformed AL code. The 'Generated code not found' message confirms the model did not produce valid output. This is a fundamental failure where the model could not complete the complex task of creating a codeunit with 10 procedures for dynamic record manipulation using RecordRef/FieldRef, plus an interface definition.

Correct Pattern:
codeunit 70226 "CG Record Introspector"
{
    Access = Public;

    procedure SerializeToJson(SourceRecord: Variant): JsonObject
    var
        RecRef: RecordRef;
        FldRef: FieldRef;
        JsonResult: JsonObject;
        MetadataObj: JsonObject;
        i: Integer;
    begin
        RecRef.GetTable(SourceRecord);
        // ... implementation for all 10 procedures
    end;
    // ... remaining procedures
}

interface "IFieldTransformer"
{
    procedure Transform(var FieldRef: FieldRef): Variant;
}
Incorrect Pattern:
// Generated code not found

Error Codes: AL0107

10 dataitem-field-scope-in-reports report-dataitem-columns 1 CG-AL-M007

Description: The model generated a complex report but incorrectly referenced field names using quoted identifiers (like '"No."' and '"Country/Region Code"') outside of the proper dataitem column context. In AL reports, fields from dataitems must be accessed through properly defined columns, and FlowFields cannot be used directly as arguments in certain contexts. The model also attempted to use FlowField values as arguments where only Normal field class types are allowed.

Correct Pattern:
In AL reports, when referencing fields from dataitems: 1) Define columns for each field you need to access: column(CustomerNo; "No.") { } 2) Use the column name (CustomerNo) in expressions, not the field name directly. 3) For FlowFields, call CalcFields before accessing the value, and don't use FlowFields as arguments where Normal fields are required. 4) Ensure field references are within the correct dataitem scope where that record variable is defined.
Incorrect Pattern:
References like '"No."' at line 267, '"Country/Region Code"' at line 367, and using FlowField as argument at lines 296 and 304

Error Codes: AL0118

11 deprecated-smtp-objects email-api-modernization 1 CG-AL-M008

Description: The model generated code that references deprecated SMTP Mail objects ('SMTP Mail Setup' table and 'SMTP Mail' codeunit) which were removed from Business Central in favor of the modern Email module. In BC v20+, the SMTP-based email functionality was replaced with the Email module that uses Email Account, Email Message, and Email codeunits. The model lacks knowledge about this API change and generated code using the old, now-removed SMTP objects.

Correct Pattern:
Use the modern Email module: Email.Send(EmailMessage, EmailAccount) with Email Message codeunit for composing emails and Email Account for sender configuration. Example:
var
  EmailMessage: Codeunit "Email Message";
  Email: Codeunit Email;
begin
  EmailMessage.Create(Recipients, Subject, Body, true);
  Email.Send(EmailMessage);
end;
Incorrect Pattern:
Table 'SMTP Mail Setup' and Codeunit 'SMTP Mail' references at lines 302-303

Error Codes: AL0185

12 interface-procedure-syntax interface-definition 1 CG-AL-M009

Description: The model generated incorrect AL interface syntax. In AL interfaces, procedure declarations should not have semicolons after the return type specification. The compilation errors at lines 15-27 all show 'Syntax error, ';' expected' which indicates the model likely used incorrect syntax for interface procedure declarations, possibly adding extra characters or using wrong delimiters. AL interface procedures should be declared as 'procedure Name(params): ReturnType;' without additional syntax elements.

Correct Pattern:
interface "Shipping Provider"
{
    procedure CalculateShippingCost(Weight: Decimal; FromCountry: Text; ToCountry: Text): Decimal;
    procedure EstimateDeliveryTime(FromCountry: Text; ToCountry: Text; ServiceType: Text): Integer;
    procedure CreateShipment(OrderNumber: Text; FromAddress: Text; ToAddress: Text; Weight: Decimal): Text[50];
    procedure TrackShipment(TrackingNumber: Text): Text[100];
    procedure ValidateAddress(Street: Text; City: Text; State: Text; ZipCode: Text; Country: Text): Boolean;
}
Incorrect Pattern:
Based on error locations (lines 15-27), the model likely wrote interface procedures with incorrect syntax, possibly using colons or other characters incorrectly in the return type declarations

Error Codes: AL0104

13 jsonobject-get-method-signature json-handling 1 CG-AL-M020

Description: The model incorrectly used JsonObject.Get() method by passing typed variables (Text, Decimal, Boolean, Integer) directly as the second argument. In AL, JsonObject.Get() requires a 'var JsonToken' as the second parameter, and you must then extract the typed value from the JsonToken using AsValue().AsText(), AsValue().AsDecimal(), etc. The model also incorrectly declared 'Dictionary' without the proper 'Dictionary of [Text, Text]' syntax.

Correct Pattern:
var
    JsonToken: JsonToken;
    ProductName: Text;
    ProductPrice: Decimal;
begin
    if ProductJson.Get('name', JsonToken) then
        ProductName := JsonToken.AsValue().AsText();
    if ProductJson.Get('price', JsonToken) then
        ProductPrice := JsonToken.AsValue().AsDecimal();
    // For Dictionary:
    var Result: Dictionary of [Text, Text];
Incorrect Pattern:
ProductJson.Get('name', ProductName); // where ProductName is Text
ProductJson.Get('price', ProductPrice); // where ProductPrice is Decimal
var Result: Dictionary; // incorrect Dictionary declaration

Error Codes: AL0133

14 foreach-json-token-syntax json-iteration 1 CG-AL-M021

Description: The model generated invalid AL syntax when iterating over JsonObject keys. In AL, you cannot use 'Key' as a loop variable name directly in a foreach statement over JsonTokens. The errors at lines 85, 114, and 170 show the model wrote something like 'foreach Key in ...' or used 'Key' incorrectly as a variable name in a context where it's being interpreted as a keyword. Additionally, line 203 shows 'key' being used where an identifier is expected, confirming the model doesn't understand proper JsonObject iteration patterns in AL.

Correct Pattern:
var KeyText: Text; KeyToken: JsonToken; ... foreach KeyText in JsonObject.Keys() do begin ... end; // Or iterate using JsonObject.Values and proper token handling
Incorrect Pattern:
foreach Key in JsonObject.Keys do ... (or similar invalid syntax using 'Key' as variable)

Error Codes: AL0519

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

Description: The test 'TestHighInventoryDiscount' failed because the model's generated code did not correctly populate the TempResult temporary table with items that have high inventory (>=100) and 15% discount. The test finds an item with Inventory >= 100 and Unit Price > 0, then calls ProcessItemsWithDiscount with MinDiscount=15, expecting to find that item in the results. The assertion 'High inventory item should be in results' failed, indicating the model either: (1) didn't correctly implement the inventory-based discount logic, (2) didn't properly insert records into the temporary table, (3) didn't correctly filter items based on MinDiscount, or (4) had issues with the temporary table parameter handling. Since the generated code was not found/empty, the model likely failed to produce valid code that correctly processes items and populates the temporary result table.

Correct Pattern:
procedure ProcessItemsWithDiscount(var TempResult: Record "CG Discount Result" temporary; MinDiscount: Decimal)
var
    Item: Record Item;
    LineNo: Integer;
    DiscountPct: Decimal;
begin
    TempResult.DeleteAll();
    LineNo := 0;
    
    Item.SetFilter("Unit Price", '>0');
    if Item.FindSet() then
        repeat
            if Item.Inventory >= 100 then
                DiscountPct := 15
            else if Item.Inventory >= 50 then
                DiscountPct := 10
            else if Item.Inventory >= 10 then
                DiscountPct := 5
            else
                DiscountPct := 0;
            
            if DiscountPct >= MinDiscount then begin
                LineNo += 1;
                TempResult.Init();
                TempResult."Line No." := LineNo;
                TempResult."Item No." := Item."No.";
                TempResult."Original Price" := Item."Unit Price";
                TempResult."Discount Percent" := DiscountPct;
                TempResult."Final Price" := Round(Item."Unit Price" * (1 - DiscountPct / 100), 0.01);
                TempResult.Insert();
            end;
        until Item.Next() = 0;
end;
Incorrect Pattern:
// Generated code not found - model failed to produce correct implementation

Error Codes: Assert.IsTrue failed. High inventory item should be in results