anthropic/claude-sonnet-4-5-20250929
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
|
||||
| 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:
Incorrect Pattern:
|
||||