← Back to Benchmark Results

anthropic/claude-sonnet-4-5-20250929

Pass Rate:55.4%
Tasks Passed:31/56
Total Shortcomings:25

All Known Shortcomings

Sorted by occurrence count (most frequent first)

# Concept AL Concept Count Affected Tasks
1 parse-failure unknown 3 CG-AL-M003, CG-AL-E009, CG-AL-H002

Description: Failed to parse LLM analysis response: {"outcome":"fixable","category":"test_logic_bug","description":"The test file references a field named 'Payment Terms' but the task definition specifies 'Payment Terms (Code[10] with TableRelation)'.

Correct Pattern:
Incorrect Pattern:
2 query-count-column-syntax query-aggregation-columns 1 CG-AL-H011

Description: The model incorrectly defined the Count column without specifying a source field. In AL queries, a column with Method = Count still requires a source field reference (typically any field from the dataitem). The model wrote 'column(Line_Count)' without a source field, but it should be 'column(Line_Count; "Line No.")' or similar with a valid field reference. Additionally, the orderby clause syntax is incorrect - it should not have empty braces.

Correct Pattern:
column(Line_Count; "Line No.")
{
    Method = Count;
}

orderby(Sell_to_Customer_No)
Incorrect Pattern:
column(Line_Count)
{
    Method = Count;
}

orderby(Sell_to_Customer_No)
{
}

Error Codes: AL0104

3 jsonobject-get-method-signature json-handling 1 CG-AL-H014

Description: The model incorrectly used JsonObject.Get() method. In AL, JsonObject.Get() requires two parameters: the key name and a var parameter to receive the JsonToken result. The model wrote 'CustomerJson.Get('name').AsValue()' treating Get() as if it returns a value directly, but the correct pattern is 'CustomerJson.Get('name', Token)' where Token is a var JsonToken parameter. Additionally, the model used a non-existent 'Get' method on JsonValue - the correct approach is to use AsText(), AsInteger(), AsDecimal(), or AsBoolean() methods on JsonValue.

Correct Pattern:
var Token: JsonToken;
var JValue: JsonValue;
if CustomerJson.Get('name', Token) then begin
    JValue := Token.AsValue();
    Name := JValue.AsText();
end;
if CustomerJson.Get('age', Token) then
    Age := Token.AsValue().AsInteger();
if CustomerJson.Get('active', Token) then
    Active := Token.AsValue().AsBoolean();
Incorrect Pattern:
CustomerJson.Get('name').AsValue().Get(Name);
CustomerJson.Get('age').AsValue().Get(Age);
ItemObject.Get('quantity').AsValue().Get(Quantity)

Error Codes: AL0135

4 dataitem-link-cross-join-conflict query-dataitem-linking 1 CG-AL-H017

Description: The model incorrectly added a DataItemLink property to the 'Dimension Set Entry' dataitem while using SqlJoinType = LeftOuterJoin after a CrossJoin. In AL queries, when using CrossJoin, the linked dataitems cannot reference fields from parent dataitems using the 'Parent.Field' syntax in DataItemLink because CrossJoin doesn't establish a proper parent-child relationship. The error AL0345 indicates that 'Department."Dimension Code"' and 'Department.Code' are not valid sources for the DataItemLink because the CrossJoin breaks the normal dataitem hierarchy. The model should either remove the DataItemLink entirely or use a different linking strategy that's compatible with the CrossJoin structure.

Correct Pattern:
dataitem(Dimension_Set_Entry; "Dimension Set Entry")
{
    SqlJoinType = LeftOuterJoin;
    // Either no DataItemLink for unlinked join, or link to immediate parent only
    // DataItemLink = "Dimension Code" = Project."Dimension Code";
    
    column(MatchCount; "Entry No.")
    {
        Method = Count;
    }
}
Incorrect Pattern:
dataitem(Dimension_Set_Entry; "Dimension Set Entry")
{
    SqlJoinType = LeftOuterJoin;
    DataItemLink = "Dimension Code" = Department."Dimension Code",
                   "Dimension Value Code" = Department.Code;
    ...

Error Codes: AL0345

5 reserved-keyword-variable-name variable-naming-rules 1 CG-AL-H020

Description: The model used 'Key' as a variable name, which is a reserved keyword in AL. In AL, 'Key' is reserved for defining keys on tables and cannot be used as a variable identifier. The compiler errors AL0519 ('Key' is not valid value in this context) and the subsequent syntax errors occur because the parser interprets 'Key' as the start of a key definition rather than a variable name.

Correct Pattern:
var
    KeyValue: Text;
...
foreach KeyValue in Keys1 do

OR

var
    DictKey: Code[20];
...
foreach DictKey in Keys do
Incorrect Pattern:
var
    Key: Text;
...
foreach Key in Keys1 do

Error Codes: AL0519

6 jsonobject-add-boolean-ambiguity json-type-handling 1 CG-AL-H023

Description: The model directly passed FldRef.Value to JsonObject.Add() for Boolean, Integer, and Decimal fields without explicit type conversion. In AL, when FldRef.Value returns a Variant, the compiler cannot determine which overload of JsonObject.Add() to use (e.g., Add(Text, Boolean) vs Add(Text, Char)). The model should have explicitly cast or assigned the value to a typed variable before adding to the JsonObject.

Correct Pattern:
FieldType::Integer:
    begin
        IntValue := FldRef.Value;
        ResultJson.Add(FldRef.Name, IntValue);
    end;
FieldType::Decimal:
    begin
        DecValue := FldRef.Value;
        ResultJson.Add(FldRef.Name, DecValue);
    end;
FieldType::Boolean:
    begin
        BoolValue := FldRef.Value;
        ResultJson.Add(FldRef.Name, BoolValue);
    end;
Incorrect Pattern:
FieldType::Integer:
    ResultJson.Add(FldRef.Name, FldRef.Value);
FieldType::Decimal:
    ResultJson.Add(FldRef.Name, FldRef.Value);
FieldType::Boolean:
    ResultJson.Add(FldRef.Name, FldRef.Value);

Error Codes: AL0196

7 integer-table-field-access temporary-table-usage 1 CG-AL-M007

Description: The model attempted to use the 'Integer' system table as a temporary record for storing customer ranking data, but incorrectly tried to access fields like 'Customer No.' and 'Sales Amount' which don't exist on the Integer table. The Integer table only has a 'Number' field. The model also incorrectly used TempRanking.Copy() syntax and tried to modify Entry No. on a record that uses Number as its primary key. This shows a fundamental misunderstanding of how to create custom temporary storage in AL - you need to define a proper table or use a different data structure like Dictionary.

Correct Pattern:
Should either use a Dictionary of [Code[20], Decimal] for customer rankings, or define a proper temporary table with the required fields. For example:
var
    CustomerRankings: Dictionary of [Code[20], Decimal];

Or define a buffer table:
table 70001 "Customer Ranking Buffer"
{
    TableType = Temporary;
    fields
    {
        field(1; "Entry No."; Integer) { }
        field(2; "Customer No."; Code[20]) { }
        field(3; "Sales Amount"; Decimal) { }
    }
}
Incorrect Pattern:
TempCustomerRanking: Record "Integer" temporary;
...
TempCustomerRanking."Customer No." := Customer."No.";
TempCustomerRanking."Sales Amount" := CustomerTotalSales;

Error Codes: AL0104

8 user-setup-field-names bc-standard-table-schema 1 CG-AL-M008

Description: The model incorrectly assumed that the 'User Setup' table contains fields named 'Approval Amount Limit', 'Approve Purchase Orders', and 'Unlimited Purchase Approval'. These fields do not exist in the standard Business Central 'User Setup' table. The actual approval-related fields in User Setup are different - the table has fields like 'Approver ID' but not the specific approval limit and permission fields the model referenced. The model should have either used the actual field names from the User Setup table or implemented a custom approval configuration approach.

Correct Pattern:
The model should use actual User Setup fields or implement custom logic. For example, use 'Approver ID' field that exists in User Setup, or create a simpler approver determination that doesn't rely on non-existent fields:

procedure DetermineApprover(PurchaseHeader: Record "Purchase Header"): Code[50]
var
    UserSetup: Record "User Setup";
begin
    // Use actual User Setup fields or return a default approver
    if UserSetup.Get(UserId) then
        if UserSetup."Approver ID" <> '' then
            exit(UserSetup."Approver ID");
    exit('ADMIN'); // Default approver
end;
Incorrect Pattern:
UserSetup.SetFilter("Approval Amount Limit", '>=%1', Amount);
UserSetup.SetRange("Approve Purchase Orders", true);
...
UserSetup.SetRange("Unlimited Purchase Approval", true);

Error Codes: AL0118

9 format-newline-syntax format-function-options 1 CG-AL-M021

Description: The model attempted to use Format('', 0, '<NewLine>') to generate a newline character, but this is not valid AL syntax. The '<NewLine>' format string is not a recognized format option in AL. The correct approach to get a newline in AL is to use character codes directly (e.g., assigning character 10 to a Text variable) or using TypeHelper.NewLine() if available. The compiler error AL0519 indicates 'Key' is not valid in context, which occurs because the Format function with invalid parameters causes parsing issues that cascade into subsequent code.

Correct Pattern:
local procedure NewLine(): Text
var
    Lf: Text[1];
begin
    Lf[1] := 10;
    exit(Lf);
end;
Incorrect Pattern:
local procedure NewLine(): Text
begin
    exit(Format('', 0, '<NewLine>'));
end;

Error Codes: AL0519

10 message-in-event-subscriber event-subscriber-testing 1 CG-AL-E010

Description: The model generated an event subscriber that uses Message() to display information when an item is created. While this is valid AL code and follows the task requirements ('displays a message when a new item is created'), it causes test failures because Message() creates an unhandled UI interaction during automated testing. In test scenarios, UI interactions like Message() must be handled with message handlers or avoided entirely. The model should have used a pattern that doesn't block tests, such as writing to a log table, using a conditional check for GuiAllowed, or simply performing a non-UI operation.

Correct Pattern:
// Option 1: Check GuiAllowed before showing message
if GuiAllowed then
    Message('A new item has been created: %1 - %2', Rec."No.", Rec.Description);

// Option 2: Write to a log table instead
// ItemLog.Init();
// ItemLog."Item No." := Rec."No.";
// ItemLog.Insert();
Incorrect Pattern:
Message('A new item has been created: %1 - %2', Rec."No.", Rec.Description);
11 event-subscriber-event-name event-subscriber-syntax 1 CG-AL-E010

Description: The model used incorrect event name 'OnAfterInsertEvent' in the EventSubscriber attribute. In Business Central AL, the correct event name for the Item table's after insert event is 'OnAfterInsert' (without 'Event' suffix). The compiler error AL0280 indicates the event 'OnAfterInsert' is not found because the model specified 'OnAfterInsertEvent' which doesn't exist on the Item table. The correct pattern for table integration events uses names like 'OnAfterInsertEvent', 'OnBeforeInsertEvent', etc. - but the error message suggests the actual event name expected differs from what was provided.

Correct Pattern:
[EventSubscriber(ObjectType::Table, Database::Item, OnAfterInsertEvent, '', false, false)] - Note: The event name should not be in quotes as it's an enum value, not a string. The correct syntax uses the event name as an identifier without quotes.
Incorrect Pattern:
[EventSubscriber(ObjectType::Table, Database::Item, 'OnAfterInsertEvent', '', false, false)]

Error Codes: AL0280

12 multiline-string-literal-syntax text-literal-syntax 1 CG-AL-E050

Description: The model attempted to use multiline string literals by simply breaking the string across multiple lines in the source code. However, AL does not support this syntax for regular string literals. In AL, string literals must be on a single line, or you must use proper string concatenation with explicit newline characters. The task asked for 'multiline string literals' which the model interpreted as raw multiline strings in source, but AL requires either concatenation with newline characters or the use of TextBuilder/StringBuilder patterns.

Correct Pattern:
exit('SELECT CustomerNo, Name, Balance' + Environment.NewLine + 'FROM Customer' + Environment.NewLine + 'WHERE Active = true' + Environment.NewLine + 'ORDER BY Name');
Incorrect Pattern:
exit('SELECT CustomerNo, Name, Balance
FROM Customer
WHERE Active = true
ORDER BY Name');

Error Codes: AL0360

13 query-orderby-syntax query-definition 1 CG-AL-H011

Description: The model incorrectly placed the 'orderby' clause outside the dataitem element. In AL queries, the OrderBy property must be defined inside the dataitem element, not at the query level. The compiler error AL0124 indicates that 'OrderBy' cannot be used in the context where the model placed it (at the query root level).

Correct Pattern:
Inside the dataitem element, use: OrderBy = ascending(Sell_to_Customer_No); or define it as part of the dataitem properties. The correct syntax places OrderBy within the dataitem scope:

dataitem(Sales_Line; "Sales Line")
{
    OrderBy = ascending(Sell_to_Customer_No);
    ...
}
Incorrect Pattern:
orderby(Sell_to_Customer_No)
{
}

Error Codes: AL0124

14 secrettext-unwrap-scope secrettext-handling 1 CG-AL-H016

Description: The model used SecretText.Unwrap() method which has scope 'OnPrem' and cannot be used in Extension development (SaaS/cloud). In Business Central extensions, SecretText values cannot be directly unwrapped to plain text for security reasons. The task requirements are contradictory for cloud/extension development - asking to unwrap secrets and return plain text is not possible in the extension scope. However, the model should have known that Unwrap() is not available for extensions and either used alternative approaches or indicated the limitation.

Correct Pattern:
For extension development, SecretText cannot be unwrapped directly. Alternative approaches include: 1) Using HttpClient with SecretText directly for authorization headers, 2) Using system codeunits that accept SecretText parameters, 3) For the task as specified, this may require OnPrem scope declaration in app.json or redesigning the API to avoid unwrapping secrets.
Incorrect Pattern:
exit('Bearer ' + ApiKey.Unwrap());
PasswordText := Password.Unwrap();
SecretText := Secret.Unwrap();

Error Codes: AL0296

15 jsonobject-add-variant-ambiguity json-object-type-handling 1 CG-AL-H023

Description: The model used FldRef.Value directly in JsonObject.Add() calls for Integer, Decimal, and Boolean field types. In AL, FldRef.Value returns a Variant, and when passing a Variant to JsonObject.Add(), the compiler cannot determine which overload to use (Add(Text, Boolean) vs Add(Text, Char) vs others). The model should have explicitly cast or assigned the value to a typed variable before adding to the JsonObject.

Correct Pattern:
FieldType::Integer:
    begin
        IntValue := FldRef.Value;
        ResultJson.Add(FldRef.Name, IntValue);
    end;
FieldType::Decimal:
    begin
        DecValue := FldRef.Value;
        ResultJson.Add(FldRef.Name, DecValue);
    end;
FieldType::Boolean:
    begin
        BoolValue := FldRef.Value;
        ResultJson.Add(FldRef.Name, BoolValue);
    end;
Incorrect Pattern:
FieldType::Integer:
    ResultJson.Add(FldRef.Name, FldRef.Value);
FieldType::Decimal:
    ResultJson.Add(FldRef.Name, FldRef.Value);
FieldType::Boolean:
    ResultJson.Add(FldRef.Name, FldRef.Value);

Error Codes: AL0196

16 cust-ledger-entry-closed-field bc-table-field-names 1 CG-AL-M006

Description: The model attempted to use a field called 'Closed' on the 'Cust. Ledger Entry' record, but this field does not exist in Business Central. The correct field name is 'Open' (Boolean), which indicates whether the entry is still open. The model should have used 'Open' = false to check for closed entries, or simply used 'Open' = true as it did elsewhere in the code. This is a knowledge gap about the actual field names in the standard BC Cust. Ledger Entry table.

Correct Pattern:
The model actually used 'Open' correctly in ValidateNewOrder procedure. The error message references line 122 which contains 'Closed' - but looking at the generated code, line 122 area shows the model used 'Open' correctly. The compilation error suggests there may be a 'Closed' reference that isn't visible in the provided code, or the line numbers don't match. However, the standard pattern should be: CustLedgerEntry.SetRange(Open, false) to find closed entries, not CustLedgerEntry.Closed.
Incorrect Pattern:
CustLedgerEntry.SetRange(Open, true);

Error Codes: AL0132

17 approval-comment-line-user-id-field standard-table-field-names 1 CG-AL-M008

Description: The model generated code that references 'User ID' field on the 'Approval Comment Line' record, but the actual field name in Business Central is 'User ID' with a different data type or the field doesn't exist as referenced. The model also incorrectly tried to add a DateTime value directly to a Date field in the CheckTimeout procedure. These are two separate AL knowledge gaps: 1) The 'Approval Comment Line' table structure and field names, and 2) DateTime arithmetic in AL requires proper type handling.

Correct Pattern:
For Approval Comment Line, use the correct field name from the actual BC table schema. For DateTime arithmetic, use CreateDateTime or proper date/time functions:
TimeoutDateTime := CreateDateTime(DT2Date(ApprovalEntry."Date-Time Sent for Approval") + TimeoutHours div 24, DT2Time(ApprovalEntry."Date-Time Sent for Approval"));
Incorrect Pattern:
ApprovalCommentLine."User ID" := UserID;
...
TimeoutDateTime := ApprovalEntry."Date-Time Sent for Approval" + (TimeoutHours * 3600000);

Error Codes: AL0132

18 newline-format-string text-formatting 1 CG-AL-M021

Description: The model attempted to use Format('', 0, '<NewLine>') to generate a newline character, which is invalid AL syntax. The '<NewLine>' format specifier doesn't exist in AL. The correct approach would be to use character codes (e.g., creating a Text variable and assigning character 10 for LF or characters 13+10 for CRLF), or using the TypeHelper codeunit's NewLine function if available. The Format function with '<NewLine>' is not a valid AL pattern.

Correct Pattern:
local procedure NewLine(): Text
var
    Lf: Text[1];
begin
    Lf[1] := 10;
    exit(Lf);
end;
Incorrect Pattern:
local procedure NewLine(): Text
begin
    exit(Format('', 0, '<NewLine>'));
end;

Error Codes: AL0224

19 report-layout-requirement report-definition 1 CG-AL-E007

Description: The model generated a valid AL report structure but failed to include a rendering section with a layout definition. In Business Central, reports require a valid layout (Word, RDLC, Excel, or Custom) to be runnable. The error 'Report 70000 does not have a valid layout' indicates the report compiles but cannot execute without a layout specification. The model should have included a rendering section with at least a basic layout definition.

Correct Pattern:
report 70000 "Customer List Report"
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    Caption = 'Customer List Report';
    DefaultRenderingLayout = CustomerListLayout;

    dataset
    {
        dataitem(Customer; Customer)
        {
            column(No_Customer; "No.")
            {
            }
            // ... other columns
        }
    }

    rendering
    {
        layout(CustomerListLayout)
        {
            Type = RDLC;
            LayoutFile = 'CustomerListReport.rdl';
        }
    }

    requestpage
    {
        // ...
    }
}
Incorrect Pattern:
report 70000 "Customer List Report"
{
    UsageCategory = ReportsAndAnalysis;
    ApplicationArea = All;
    Caption = 'Customer List Report';

    dataset
    {
        dataitem(Customer; Customer)
        {
            column(No_Customer; "No.")
            {
            }
            // ... other columns
        }
    }

    requestpage
    {
        // ...
    }
}
20 asserterror-delete-trigger-execution record-deletion-triggers 1 CG-AL-E031

Description: The test expects that calling Plan.Delete() on an active subscription plan will trigger an error via the OnDelete trigger. However, the test shows 'An error was expected inside an ASSERTERROR statement' which means no error was raised. The model's OnDelete trigger code looks correct, but the issue is that the record was already deleted in the first test (TestDefaultsAndInsertTriggers) which calls Plan.Delete() at the end. When TestDeleteBlockedWhenActiveAndAllowedWhenInactive runs, it creates a new record with Insert(true), but the Active field's InitValue=true should make it active. The actual issue is that the model's code is correct - the OnDelete trigger should fire. The test failure suggests the Delete() call succeeded without error, meaning either the trigger didn't fire or the Active field wasn't true. Looking more carefully, the model's code appears correct. The issue may be that Insert(true) doesn't trigger field InitValues the same way, or there's a runtime behavior difference. However, since the generated code matches the specification exactly and the test is validating correct behavior, this appears to be a model knowledge gap about how InitValue interacts with Insert(true) - the model may need to explicitly set Active := true in OnInsert if InitValue doesn't apply when the field hasn't been touched.

Correct Pattern:
The OnInsert trigger should explicitly ensure Active is set to true if relying on InitValue behavior:

trigger OnInsert()
begin
    if "Created Date" = 0D then
        "Created Date" := WorkDate();
    "Last Modified DateTime" := CurrentDateTime();
    // InitValue may not apply in all Insert scenarios
    // Could add: if not Active then Active := true;
end;

Alternatively, the InitValue should work but the model needs to understand BC's InitValue behavior with Insert(true).
Incorrect Pattern:
field(4; Active; Boolean)
{
    Caption = 'Active';
    DataClassification = CustomerContent;
    InitValue = true;
}

trigger OnInsert()
begin
    if "Created Date" = 0D then
        "Created Date" := WorkDate();
    "Last Modified DateTime" := CurrentDateTime();
end;
21 format-decimal-locale format-function-behavior 1 CG-AL-H005

Description: The model correctly implemented the OnModify trigger logic to detect changes and create audit log entries. However, the test is failing because the Format() function for Decimal values in AL includes locale-specific formatting. When formatting decimal values like 100 or 150, Format() may produce strings like '100.00' or include thousand separators, not just '100' or '150' as the test expects. The test uses SetFilter with '%1', '100' which looks for exact match '100', but Format(xRec."Unit Price") where Unit Price is 100.00 (Decimal) likely produces '100' with decimal places or different formatting.

Correct Pattern:
The model's code is technically correct per the task requirements. The issue is that Format() on Decimal values produces locale-dependent output. The test should either: 1) Use wildcard filters like '*100*' or 2) The task should specify exact format requirements like Format(value, 0, '<Integer>') to control output format.
Incorrect Pattern:
AuditLog."Old Value" := Format(xRec."Unit Price");
AuditLog."New Value" := Format(Rec."Unit Price");
22 interface-collections-bc25 interface-collections 1 CG-AL-H021

Description: The model generated code using 'List of [Interface INotificationChannel]' and 'Dictionary of [Text, Interface INotificationChannel]' syntax. This feature (Lists and Dictionaries of interfaces) is only available in BC 2025 Wave 1 (version 26+). The error 'C# compilation has failed' indicates the runtime/compiler doesn't support this syntax. The model correctly understood the task requirements but the generated code may have syntax issues with interface references in generic collections. In AL, when referencing interfaces in generic type declarations, quotes are required around the interface name: 'List of [Interface "INotificationChannel"]' not 'List of [Interface INotificationChannel]'.

Correct Pattern:
var
    ChannelList: List of [Interface "INotificationChannel"];
    ChannelDictionary: Dictionary of [Text, Interface "INotificationChannel"];
Incorrect Pattern:
var
    ChannelList: List of [Interface INotificationChannel];
    ChannelDictionary: Dictionary of [Text, Interface INotificationChannel];
23 duration-evaluation-syntax data-type-conversion 1 CG-AL-M005

Description: The model attempted to use Evaluate() to convert a text label '00:00:30' into a Duration type, but AL's Evaluate function cannot parse duration values from text in this format. The error 'The value "00:00:30" can't be evaluated into type Duration' shows the model doesn't understand how to properly set Duration values in AL. Duration in AL is measured in milliseconds as an integer, not as a time-formatted string.

Correct Pattern:
local procedure ConfigureTimeout(var Client: HttpClient)
begin
    Client.Timeout := 30000; // Duration is in milliseconds, assign directly as integer
end;

// Or if you need a Duration variable:
var
    TimeoutDuration: Duration;
begin
    TimeoutDuration := 30000; // 30 seconds in milliseconds
    Client.Timeout := TimeoutDuration;
end;
Incorrect Pattern:
local procedure ConfigureTimeout(var Client: HttpClient)
var
    TimeoutDuration: Duration;
begin
    Evaluate(TimeoutDuration, TimeoutDurationTxt);
    Client.Timeout := 30000; // 30 seconds in milliseconds
end;
24 flowfield-calcformula-multiplication flowfield-definition 1 CG-AL-M010

Description: The model defined a FlowField 'Actual Cost' on the Project Task table using multiplication in the CalcFormula (sum of Actual Hours * Hourly Rate), which is not supported in AL. FlowFields with CalcFormula can only use simple aggregation functions (sum, count, average, min, max, exist, lookup) on a single field - they cannot perform arithmetic operations between fields. This causes a runtime error 'A flow field is part of the query column list, this is not supported' when the page tries to load. Additionally, the Project table references this invalid FlowField in its own CalcFormula, compounding the issue.

Correct Pattern:
For calculated values involving multiple fields, use a regular Decimal field and calculate the value in code (e.g., in OnValidate triggers or a procedure), or create a separate stored field that gets updated when source fields change. FlowFields can only aggregate a single field:

field(8; "Actual Cost"; Decimal)
{
    Caption = 'Actual Cost';
    DataClassification = CustomerContent;
    Editable = false;
}

Then calculate in code: "Actual Cost" := "Actual Hours" * "Hourly Rate";
Incorrect Pattern:
field(8; "Actual Cost"; Decimal)
{
    Caption = 'Actual Cost';
    FieldClass = FlowField;
    CalcFormula = sum("Project Task"."Actual Hours" * "Project Task"."Hourly Rate" where("Project Code" = field("Project Code"), "Task Code" = field("Task Code")));
    Editable = false;
}
25 autoincrement-field-insert-handling autoincrement-primary-key 1 CG-AL-M112

Description: The model correctly implemented AutoIncrement on the Entry No. field, but the test is failing because when inserting records with AutoIncrement fields, the test code is not properly handling the auto-generated values. The error 'The record in table CG Time Entry already exists. Identification fields and values: Entry No.=13' indicates that the AutoIncrement mechanism is working, but there's a conflict with existing records from previous test runs. The model's implementation is correct - the issue is that AutoIncrement fields in BC maintain their sequence across test runs in the same session, and the test doesn't account for this. However, looking more carefully, the real issue is that the model's code is correct but the test is calling Insert(true) which triggers validation, and the AutoIncrement should handle unique values automatically. The failure suggests residual data from previous failed test runs. This is actually a test isolation issue, but since the model's code is functionally correct and follows the task requirements exactly, this represents a gap in understanding how AutoIncrement interacts with test isolation in BC.

Correct Pattern:
The generated code is actually correct. The AutoIncrement property is properly set. The issue is that BC's AutoIncrement maintains state across test runs in the same session. The test should either use a fresh database state or the cleanup from previous test runs failed, leaving orphan records. The model's implementation follows the task requirements correctly.
Incorrect Pattern:
field(1; "Entry No."; Integer)
{
    Caption = 'Entry No.';
    DataClassification = CustomerContent;
    AutoIncrement = true;
}