anthropic/claude-opus-4-5-20251101
All Known Shortcomings
Sorted by occurrence count (most frequent first)
| # | Concept | AL Concept | Count | Affected Tasks |
|---|---|---|---|---|
| 1 | parse-failure | unknown | 2 | CG-AL-H003, CG-AL-H002 |
|
Description: Failed to parse LLM analysis response: {"outcome":"test_logic_bug","category":"test_logic_bug","description":"The test TestHighInventoryDiscount assumes that if an Item with Inventory >= 100 and Unit Price > 0 exists in the database, it wi
Correct Pattern:
Incorrect Pattern:
|
||||
| 2 | reserved-keyword-variable-name | variable-naming | 1 | CG-AL-H020 |
|
Description: The model used 'Key' as a variable name, but 'Key' is a reserved keyword in AL. The compiler errors AL0519 ('Key' is not valid value in this context) and subsequent syntax errors occur because the AL compiler interprets 'Key' as a keyword rather than a variable identifier. The model should have used a different variable name like 'DictKey' or 'KeyValue' to avoid the reserved keyword conflict.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0519 |
||||
| 3 | message-in-event-subscriber | event-subscriber-patterns | 1 | CG-AL-E010 |
|
Description: The model generated an event subscriber that calls Message() inside the OnAfterInsertEvent handler. In automated test scenarios, Message() causes an 'Unhandled UI' error because there's no user interface to display the message. Event subscribers that run during automated tests should not use UI-blocking functions like Message(), Error(), or Confirm() unless properly handled. The task asked to 'display a message when a new item is created' but in a test context, this pattern fails. The model should have used a non-UI approach like logging to a table, or the code should check if it's running in a test context.
Correct Pattern:
Incorrect Pattern:
Error Codes: Unhandled UI: Message |
||||
| 4 | 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 - text literals must be terminated on the same line they start. AL requires either string concatenation with '+' operator or using the newer AL multiline string literal syntax with triple single quotes ('''...''') introduced in later BC versions. The model incorrectly assumed that breaking a string across lines would work like in some other languages.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0360 |
||||
| 5 | isolated-storage-secrettext-overload | isolated-storage-api | 1 | CG-AL-H016 |
|
Description: The model incorrectly used IsolatedStorage.Set() with a SecretText parameter directly. In AL, IsolatedStorage.Set() has specific overloads for SecretText handling. The model passed SecretText as the second argument, but the compiler expects either a Text value or an array of SecretText for certain overloads. The correct approach is to use the proper IsolatedStorage.SetEncrypted() method or ensure the correct overload signature is used for storing SecretText values.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0133 |
||||
| 6 | reserved-keyword-variable-name | variable-naming-rules | 1 | CG-AL-H020 |
|
Description: The model used 'Key' as a variable name, but 'Key' is a reserved keyword in AL. The compiler errors AL0519 ('Key' is not valid value in this context) and the subsequent syntax errors occur because the AL compiler interprets 'Key' as a keyword rather than a variable identifier. The model should have used a different variable name like 'DictKey', 'KeyValue', or 'K' to avoid the reserved keyword conflict.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0519 |
||||
| 7 | else-statement-semicolon | control-flow-syntax | 1 | CG-AL-H023 |
|
Description: The model generated code with an orphaned ELSE statement, which occurs when a semicolon is incorrectly placed before the ELSE keyword. In AL, the statement before ELSE in an IF-THEN-ELSE construct must NOT end with a semicolon. The model failed to generate any code file (indicated by 'Generated code not found'), and the compilation error AL0110 indicates the model produced syntactically invalid AL code with improper control flow structure.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0110 |
||||
| 8 | unused-variable-declaration | variable-usage | 1 | CG-AL-M003 |
|
Description: The model declared a variable 'NoSeriesManagement: Codeunit NoSeriesManagement' in the GetNextContractNo procedure but never used it. The compiler error AL0185 indicates the codeunit 'NoSeriesManagement' is missing - this is because the model referenced a codeunit that doesn't exist in the standard BC application (it was renamed/restructured in newer versions). The model attempted to use a pattern for number series management but declared an unnecessary variable for a codeunit that doesn't exist, and then implemented its own logic anyway without using it.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0185 |
||||
| 9 | session-logmessage-signature | telemetry-logging | 1 | CG-AL-M005 |
|
Description: The model generated code that calls Session.LogMessage with 11 arguments, but the AL built-in LogMessage method only accepts either 9 arguments (with optional last two) or 6 arguments (with Dictionary). The model likely attempted to use a non-existent overload of the LogMessage procedure. Looking at the error at line 272, the model's LogError procedure or some telemetry logging code is incorrectly calling LogMessage with too many parameters.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0126 |
||||
| 10 | buffer-table-field-names | temporary-table-handling | 1 | CG-AL-M007 |
|
Description: The model attempted to use non-existent fields on Business Central buffer tables. It referenced 'Item No.', 'Description', 'Quantity (Base)' on 'Item Statistics Buffer' and 'Customer No.', 'No. of Invoices' on 'Customer Sales Buffer'. These are standard BC temporary buffer tables but the model assumed incorrect field names. The generated code shown doesn't include these buffer tables, suggesting the model generated additional code beyond what was provided that uses these tables incorrectly. The model lacks knowledge of the actual field structure of BC buffer tables.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0132 |
||||
| 11 | flowfield-calcformula-syntax | flowfield-definition | 1 | CG-AL-M010 |
|
Description: The model incorrectly used a multiplication expression within the CalcFormula for a FlowField. In AL, CalcFormula does not support arithmetic operations like multiplication between fields. The CalcFormula can only use aggregate functions (Sum, Count, Average, Min, Max, Exist, Lookup) on a single field with optional filters. To calculate 'Actual Hours * Hourly Rate', you cannot use a FlowField with CalcFormula - you would need either a calculated field updated via triggers, or calculate it in code.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0104 |
||||
| 12 | multi-table-generation | table-definition | 1 | CG-AL-M112 |
|
Description: The task required creating TWO tables: 'CG Project' (ID 70112) and 'CG Time Entry' (ID 70113). The model only generated the first table 'CG Project' and completely omitted the second table 'CG Time Entry'. This caused compilation errors because the 'CG Project' table references 'CG Time Entry' in its FlowField CalcFormula and OnDelete trigger, but that table doesn't exist.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0185 |
||||
| 13 | report-layout-requirement | report-definition | 1 | CG-AL-E007 |
|
Description: The model generated a valid AL report structure with correct dataset columns, but failed to include 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 rendering layout. The model should have either included a DefaultRenderingLayout property pointing to a layout file, or included an rdlcLayout/wordLayout property, or at minimum a rendering section.
Correct Pattern:
Incorrect Pattern:
|
||||
| 14 | flowfield-calcfields-requirement | flowfield | 1 | CG-AL-E009 |
|
Description: The model correctly created the XMLport structure, but the test fails because the 'Inventory' field on the Item table is a FlowField. When exporting FlowFields via XMLport, the value is not automatically calculated - it exports as 0 or empty unless CalcFields is called. The model should have added a trigger to calculate the Inventory field before export, or the XMLport needs OnBeforePassField/OnAfterGetRecord trigger to call CalcFields on the Inventory field.
Correct Pattern:
Incorrect Pattern:
|
||||
| 15 | ondelete-trigger-active-check | table-triggers | 1 | CG-AL-E031 |
|
Description: The model generated an OnDelete trigger that checks 'if Rec.Active then Error(...)'. However, the test shows that when a record is inserted with Active defaulting to true (via InitValue), and then the test calls Plan.Delete(), the asserterror expects an error but none is raised. The issue is that the Active field has InitValue = true, but when the record is retrieved after insert and delete is called, the OnDelete trigger's check of Rec.Active should find it true. The test failure 'An error was expected inside an ASSERTERROR statement' indicates the OnDelete trigger did NOT raise an error when it should have. This suggests the model's code may have an issue with how the Active field value is being read in the OnDelete trigger context, or there's a subtle issue with how InitValue works with the trigger check.
Correct Pattern:
Incorrect Pattern:
|
||||
| 16 | temporary-table-parameter-instance-isolation | temporary-table | 1 | CG-AL-H003 |
|
Description: The model's code is technically correct for temporary table handling, but the test failure reveals a subtle issue with how the test environment works. The test 'TestHighInventoryDiscount' searches for an Item with Inventory >= 100 and Unit Price > 0, then calls ProcessItemsWithDiscount expecting that item to appear in results. The test fails because either: (1) no items in the test database meet the criteria (Inventory >= 100 AND Unit Price > 0), or (2) there's a mismatch between how the test finds items and how the processor filters them. The model correctly implemented the logic, but the test assumes specific data exists in the database. However, looking more carefully - the model's code filters Item.SetFilter("Unit Price", '>0') which should match the test's filter. The real issue is that the test database may not have items with both high inventory AND positive unit price. This is actually a test_logic_bug since the test assumes data exists without ensuring it.
Correct Pattern:
Incorrect Pattern:
|
||||
| 17 | format-decimal-locale | decimal-formatting | 1 | CG-AL-H005 |
|
Description: The model correctly implemented the OnModify trigger logic to detect changes and create audit log entries. However, the test fails because the Format() function for Decimal values in Business Central includes locale-specific formatting (e.g., '100.00' instead of '100'). The test filters for exact string matches like '100' and '150', but Format(xRec."Unit Price") produces formatted decimal strings that may include decimal places (e.g., '100.00' or locale-specific formatting). The model's code is functionally correct, but the formatted output doesn't match the test's expected string values.
Correct Pattern:
Incorrect Pattern:
|
||||
| 18 | interface-collections-bc-version | interface-collections | 1 | CG-AL-H021 |
|
Description: The model generated code using 'List of [Interface "INotificationChannel"]' and 'Dictionary of [Text, Interface "INotificationChannel"]' which are features introduced in BC 2025 Wave 1. The error 'System.InvalidOperationException: C# compilation has failed for the application object CodeUnit_70220' indicates that the runtime/compiler doesn't support interfaces as generic type parameters in List and Dictionary collections. This is likely because the BC container being used doesn't have the 2025 Wave 1 runtime that supports this feature. The model correctly implemented the syntax as specified in the task, but the test environment doesn't support this BC version-specific feature.
Correct Pattern:
Incorrect Pattern:
|
||||
| 19 | api-page-field-name-mapping | api-page-design | 1 | CG-AL-M001 |
|
Description: The model created an API page with field names that don't match what the test expects. The test expects 'productCode' to map to the record's 'No.' field (Product.SetRange("No.", ProductCode)), but the model created a separate 'Product Code' field and mapped 'productCode' to that instead of 'No.'. The test creates products using productCode.SetValue() and expects it to populate the 'No.' field, but the generated code has 'number' mapped to 'No.' and 'productCode' mapped to a separate 'Product Code' field. Additionally, the error messages for validation don't match - test expects 'Price must be positive' but model generates 'Unit Price must be a positive value. Current value: %1', and test expects 'Stock must be non-negative' but model generates 'Stock Quantity must be non-negative. Current value: %1'.
Correct Pattern:
Incorrect Pattern:
|
||||
| 20 | risk-level-option-values | option-field-definition | 1 | CG-AL-M006 |
|
Description: The model defined the Risk Level option field with a blank first option (' ',Low,Medium,High,Critical) instead of starting with the actual values (Low,Medium,High,Critical). This causes the option ordinal values to be off by one. The test expects 'Low' to be ordinal 0, 'Medium' to be 1, 'High' to be 2, and 'Critical' to be 3, but the model's definition makes them 1, 2, 3, and 4 respectively. Additionally, the model's UpdateRiskLevel() uses different credit score thresholds than what the tests expect (model uses 750/650/550 boundaries with payment history adjustment, but tests expect specific ranges like 300-499=Critical, 500-579=High, 580-669=Medium, 670+=Low). The ValidateNewOrder function also throws an error instead of returning false for rejected orders, and the test cleanup after asserterror fails because the record doesn't exist (asserterror rolls back the transaction including the customer creation).
Correct Pattern:
Incorrect Pattern:
|
||||
| 21 | codeunit-instance-state-persistence | codeunit-state-management | 1 | CG-AL-M008 |
|
Description: The model implemented workflow state using Dictionary variables at the codeunit level, but these are instance-scoped and not persisted between codeunit calls. In the test, InitiateApprovalProcess is called, then ProcessApprovalRequest with 'APPROVE' action, which internally calls CompleteApprovalProcess and sets status to 2 (Approved). When the test then calls CompleteApprovalProcess directly, the status is already 2 (not 1/Pending), so the function returns false because it checks 'if CurrentStatus = 1' before completing. The model failed to understand that after approval, the status changes and subsequent CompleteApprovalProcess calls would fail the pending check.
Correct Pattern:
Incorrect Pattern:
|
||||