openrouter/z-ai/glm-5
Known Shortcomings (25)
Sorted by occurrence count (most frequent first)
| # | Concept | AL Concept | Count | Affected Tasks |
|---|---|---|---|---|
| 1 | 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' at line 13:32, AL0104 '=' expected, etc.) indicate the model produced syntactically invalid AL for the query object definition. The 'Generated code not found' note and the nature of the errors (syntax errors in the generated .al file, not the test file) suggest the model either failed to produce output or produced malformed query object syntax. AL query objects have a specific structure with dataitems, columns, and filter elements that the model did not correctly implement.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0107, AL0353 |
||||
| 2 | list-dictionary-of-interface-clear-method | interface-collections | 1 | CG-AL-H021 |
|
Description: The model generated code that calls .Clear() on List of [Interface ...] and Dictionary of [Text, Interface ...] variables. In AL, the List and Dictionary types that hold interface values do not expose a .Clear() method. The correct approach to clear these collections is to reassign them to fresh/empty instances, e.g., by declaring new local variables or by using Clear() as a built-in function (Clear(varName)) rather than as a method call on the variable. The model lacked knowledge about how to properly clear collections of interface types in AL.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0132 |
||||
| 3 | event-subscriber-event-name | event-subscription | 1 | CG-AL-E010 |
|
Description: The model used the wrong event name 'OnAfterInsert' when subscribing to the Item table's insert event. In Business Central AL, the correct event name for table record insertion is 'OnAfterInsertEvent', not 'OnAfterInsert'. The compiler error AL0280 confirms that 'OnAfterInsert' is not found as an event on the Item table. The model lacks knowledge of the correct BC integration event naming convention for table triggers, which follow the pattern 'On{Before|After}{Insert|Modify|Delete|Rename}Event'.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0280 |
||||
| 4 | al-string-literal-escaping | string-handling | 1 | CG-AL-H014 |
|
Description: The model generated code with an improperly terminated text literal on line 12. In AL, single quotes within string literals must be escaped by doubling them (''). The model likely produced a format string like 'Name: %1, Age: %2, Active: %3' or used StrSubstNo with improperly escaped quotes, or used a string concatenation that broke the text literal. The AL0360 error 'Text literal was not properly terminated' indicates the model didn't correctly handle AL string syntax, causing a cascade of syntax errors.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0360 |
||||
| 5 | fluent-api-return-self-codeunit | codeunit-self-reference | 1 | CG-AL-H018 |
|
Description: The model attempted to use 'Self' to return the current codeunit instance for fluent API chaining, but 'Self' is not a valid keyword in AL. In AL, to implement a fluent API pattern where methods return the current codeunit instance, you need to use a different approach. Since codeunits are value types in AL, the typical pattern is to declare a local variable of the same codeunit type, assign it using 'this' (available in newer AL versions) or pass the codeunit as a VAR parameter. In modern AL (BC runtime 11.0+), you can use 'this' keyword to return the current instance. Alternatively, you can declare the return variable and copy state into it.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0118 |
||||
| 6 | user-setup-field-reference | bc-table-field-names | 1 | CG-AL-M008 |
|
Description: The model generated code that references a field called 'Approval Amount Limit' which does not exist in the current context (likely trying to reference a field from the User Setup table or similar). The model incorrectly assumed the field name or tried to use it without properly accessing the correct table/record. In Business Central, the User Setup table (table 91) has a field called 'Approval Amount' (not 'Approval Amount Limit'), or the model may have been referencing 'Approver ID' and amount limit fields that don't exist with that exact name. The correct field name in the User Setup table is typically 'Purchase Amount Approval Limit' or similar, and the model used an incorrect field name.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0118 |
||||
| 7 | multiline-string-literals | al-string-syntax | 1 | CG-AL-E050 |
|
Description: The model attempted to use backtick (`) characters for multiline string literals, which is not valid AL syntax. AL does not support backtick-delimited multiline strings like some other languages (e.g., JavaScript template literals). In AL, multiline text literals were introduced in later runtime versions using a specific syntax (e.g., text constants with line breaks or the newer AL multiline string literal syntax). The model likely confused AL's multiline string syntax with another language's syntax, producing compilation errors starting at line 8 with 'Unexpected character `'. The correct approach in AL would be to either use string concatenation with CR/LF characters, or use the proper AL multiline string literal syntax (available in newer runtimes) which uses single quotes with line continuation, not backticks.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0183 |
||||
| 8 | secrettext-unwrap-scope | SecretText-handling | 1 | CG-AL-H016 |
|
Description: The model used SecretText.Unwrap() to extract the plain text value from a SecretText variable. However, the Unwrap() method has scope 'OnPrem' and cannot be used in Extension (cloud/SaaS) development. The correct approach for cloud-compatible extensions is to use format functions or specific overloads that accept SecretText. For example, to get the text value from a SecretText in an extension context, one can use the SecretText in an HttpAuthorizationHeader or use IsolatedStorage.Get with SecretText overloads. For string concatenation, one approach is to use SecretStrSubstNo to build the string while it's still SecretText, then if the result must be returned as Text, the task itself may be inherently OnPrem-scoped. The model should have either recognized the need for target=OnPrem in app.json, or used alternative patterns to avoid Unwrap() calls.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0296 |
||||
| 9 | reserved-keyword-as-parameter-name | al-syntax-reserved-words | 1 | CG-AL-M020 |
|
Description: The model used 'key' as a parameter name in the procedure signature (likely for ParseConfigSettings or another procedure), but 'key' is a reserved keyword in AL. The model also had syntax errors around line 86 involving Dictionary iteration syntax. The task prompt used 'Key' as a parameter name for ExtractWithDefaults, which the model likely translated directly, but in AL 'key' (case-insensitive) is a reserved keyword and cannot be used as an identifier. The model should have used an alternative name like 'KeyName' or 'SearchKey'. Additionally, the model appears to have incorrect syntax for iterating over Dictionary or JsonObject keys.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0105 |
||||
| 10 | string-literal-quoting | al-syntax-basics | 1 | CG-AL-E045 |
|
Description: The model generated AL code with improperly terminated string identifiers on line 19 of the generated file. The AL0361 error 'Identifier was not properly terminated. Use the character " to terminate the identifier.' indicates the model likely used incorrect quote characters (e.g., smart/curly quotes instead of straight double quotes) or failed to properly close a quoted identifier in the error message string or field name. This is a fundamental AL syntax issue where the model didn't produce valid AL code.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0361 |
||||
| 11 | interface-and-implementation-syntax | interface-definition | 1 | CG-AL-M009 |
|
Description: The model failed to generate valid AL code for the interface and implementation pattern. The compilation errors at line 92 indicate a syntax error ('end' expected, ';' expected, '}' expected), suggesting the model produced malformed AL code - likely incorrect syntax in the interface definition or the implementing codeunit. The generated code file was noted as 'not found' in the analysis but compilation was attempted on CG-AL-M009.al which had syntax errors. The model doesn't properly understand AL interface declaration syntax (which has no object ID, uses 'interface' keyword) and/or the 'implements' keyword on codeunits. Additionally, the test references a mock codeunit 'CG-AL-M009 Mock Shipping' that the model would also need to produce or that should be provided separately - but the primary failure is the model's inability to produce syntactically correct AL interface and implementation code.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0104 |
||||
| 12 | dictionary-key-iteration-syntax | dictionary-foreach-syntax | 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 used 'Key' as a variable identifier at lines 52 and 95, which caused AL0519 ('Key' is not valid value in this context) and subsequent syntax errors. The correct pattern in AL for iterating dictionary keys is to use a properly declared variable name (not 'Key') and use the Dictionary.Keys() method with a foreach loop, e.g., 'foreach MyKey in Dict.Keys do'.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0519 |
||||
| 13 | string-literal-quoting-in-calcformula | flowfield-calcformula-syntax | 1 | CG-AL-M112 |
|
Description: The model generated a CalcFormula expression with improperly terminated string identifiers. The AL0361 error 'Identifier was not properly terminated' at line 32 column 81 indicates the model likely used incorrect quoting (e.g., single quotes or unescaped double quotes) within the CalcFormula property for FlowField definitions referencing table/field names like "CG Time Entry" and "Project No.". In AL, identifiers containing spaces in CalcFormula expressions must be enclosed in double quotes, and when inside a string property value, these need to be properly escaped. The model failed to produce syntactically valid CalcFormula expressions for the FlowField fields 'Total Posted Hours' and 'Total Open Hours'.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0361 |
||||
| 14 | empty-or-missing-code-generation | codeunit-definition | 1 | CG-AL-H009 |
|
Description: The model failed to generate any valid AL code. The generated code was either empty or contained only a comment/placeholder that is not valid AL syntax. The compilation errors ('{' expected, '}' expected, expected application object keyword) at position 1:38 indicate the file content was not a valid AL object definition at all. The task and test are perfectly valid - the model simply failed to produce the required codeunit implementing currency rounding patterns.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0104 |
||||
| 15 | complex-report-and-codeunit-generation | report-definition-with-helper-codeunit | 1 | CG-AL-M007 |
|
Description: The model failed to generate valid AL code for a complex task requiring both a Report object (Sales Performance Analysis, ID 70001) and a helper codeunit (CG-AL-M007 Mock Calculator). The compilation error AL0104 at line 327 indicates a syntax error in the generated code (likely a misplaced token or malformed expression). The generated code was not captured/found but the syntax error at line 327 suggests the model produced a large file with a syntax mistake deep in the code, possibly in a complex expression, variable declaration, or trigger body. The task requires generating a report with multiple data items, complex triggers, and a separate mock calculator codeunit with methods like Initialize(), AddSalesLine(), GetRunningTotalByCustomer(), GetRunningTotalByRegion(), CalculateAverageOrderValue(), GetCustomerRank(), GetTopProduct(), GetProductSalesQuantity(), CalculateYoYComparison(), CalculateOrderFrequency(), GetTotalSales(), and GetCustomerCount(). The model likely struggled with the complexity of generating both objects correctly with proper AL syntax.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0104 |
||||
| 16 | rec-xrec-onmodify-trigger | trigger-implementation | 1 | CG-AL-H005 |
|
Description: The model failed to generate the correct AL code for this task. The tests show that the OnModify trigger on the 'CG Tracked Item' table is not creating audit log entries when fields change. The generated code was not found/captured, but the test failures indicate that either: (1) the OnModify trigger was not implemented at all, (2) the trigger was implemented incorrectly and doesn't properly compare Rec vs xRec to detect changes, or (3) the audit log insertion logic is missing or broken. The key AL concept here is using xRec in the OnModify trigger to detect field-level changes and creating corresponding audit log records. The model needed to implement an OnModify trigger that compares Rec."Unit Price" <> xRec."Unit Price" and (not xRec.Blocked) and Rec.Blocked to create appropriate audit log entries.
Correct Pattern:
Incorrect Pattern:
Error Codes: Assert.IsFalse failed. Audit log entry should exist for price change |
||||
| 17 | parse-failure | unknown | 1 | CG-AL-E052 |
|
Description: Failed to parse LLM analysis response: Looking at the failure details: 1. The generated code compiled successfully and was published 2. Most tests pass, but `TestDateToText_ValidDate` and `TestDateToText_FirstDayOfYear` fail 3. The test f
Correct Pattern:
Incorrect Pattern:
|
||||
| 18 | multiline-string-literals | string-operations | 1 | CG-AL-E050 |
|
Description: The model failed to generate valid AL code using multiline string literals. The compilation errors (AL0361 - unterminated identifier, multiple semicolon expected errors on consecutive lines) indicate the model likely attempted to use raw multiline strings or an incorrect syntax for multiline text literals in AL. In AL, multiline string literals were not supported until recent runtime versions, and the correct approach depends on the runtime version. The model either used an unsupported syntax (e.g., Python/C#-style multiline strings) or failed to properly use AL's multiline text literal syntax (which uses single quotes and allows line breaks within them in newer runtimes). The generated code file appears to have been produced but contained syntax that the AL compiler could not parse, with unterminated identifiers and missing delimiters across multiple lines.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0361 |
||||
| 19 | jsonobject-get-method-signatures | json-api-usage | 1 | CG-AL-H014 |
|
Description: The model misunderstood the AL JsonObject getter method signatures. In AL, methods like JsonObject.Get(Text, var JsonToken) return Boolean (success/failure) and output the value via a var parameter. There are no direct typed getter methods like GetText('name'), GetInteger('age'), GetBoolean('active') that return the value directly. The task description uses fictional method names that don't exist in the AL JSON API. However, the model attempted to use these non-existent methods and got the signatures wrong - it appears to have called methods like Get() or SelectToken() with incorrect argument types, passing Text/Integer/Decimal where Boolean was expected. The correct pattern is to use JsonObject.Get('key', JsonToken) which returns Boolean, then convert the JsonToken to the appropriate type via AsValue().AsText(), AsValue().AsInteger(), etc.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0133 |
||||
| 20 | dictionary-iteration-syntax | dictionary-type-usage | 1 | CG-AL-H018 |
|
Description: The model generated code that iterates over a Dictionary of [Text, Text] using invalid syntax. At line 43, it used 'Key' in a context that is not valid AL syntax. In AL, to iterate over a Dictionary you must use the Dictionary.Keys() method to get the key list and then iterate with foreach, or use Get() method. The model likely wrote something like 'foreach Key in RequestHeaders' or used 'Key' as a variable name in an invalid expression context, resulting in AL0519 ('Key' is not valid value in this context) and related syntax errors.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0519 |
||||
| 21 | dictionary-foreach-syntax | collections-iteration | 1 | CG-AL-H020 |
|
Description: The model generated code with invalid syntax when iterating over a Dictionary. The error at line 52 indicates the model likely used a pattern like 'foreach Key in Dict.Keys' or similar invalid syntax with 'Key' as a keyword/identifier in a context where AL expects different syntax. In AL, iterating over dictionary keys requires using the 'Keys' method to get a List and then iterating, or using 'foreach KeyVar in Dict.Keys() do'. The model appears to have used 'Key' as a reserved word or used incorrect colon syntax (e.g., 'Key: Value' destructuring pattern) which is not valid AL.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0519 |
||||
| 22 | tryfunction-boolean-return-pattern | error-handling-recordref | 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 when opening invalid table IDs, the model should use a [TryFunction] pattern or wrap the call in an if-then with TryFunction helper. The AL0173 errors at lines 10, 23, and 103 indicate the model wrote something like 'if not RecRef.Open(TableId) then' which is invalid because Open() doesn't return a value. The correct pattern is to use a separate [TryFunction] procedure that wraps the Open call, or to use a combination of OnRun trigger patterns for error handling.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0173 |
||||
| 23 | record-field-access-in-action-enabled | page-action-enabled-expression | 1 | CG-AL-M004 |
|
Description: The model generated code that references 'Status' directly in action Enabled expressions (lines 72 and 87) without properly qualifying the field reference. In AL page definitions, when using Enabled property expressions for actions, you need to reference the source record field through the record variable (e.g., Rec.Status) rather than just 'Status'. The error AL0118 'The name Status does not exist in the current context' indicates the model used bare 'Status' references in the Enabled property of the CalculateTotals and ApplyDiscount actions. The correct pattern is to use 'Enabled = (Rec.Status <> Rec.Status::Released)' or to use a global boolean variable set in OnAfterGetRecord/OnAfterGetCurrRecord triggers.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0118 |
||||
| 24 | event-subscriber-in-table-extension | table-extension-structure | 1 | CG-AL-M006 |
|
Description: The model attempted to use an [EventSubscriber] attribute inside a tableextension object. In AL, EventSubscriber procedures cannot be placed inside table extensions - they must be placed in a codeunit. The model likely tried to add an event subscriber procedure directly in the tableextension body around line 197, which caused a cascade of syntax errors (AL0124: 'The property EventSubscriber cannot be used in this context'). Table extensions can only contain field definitions, keys, field groups, triggers, and regular procedures - not event subscriber methods.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0124 |
||||
| 25 | reserved-keyword-as-variable-name | al-reserved-keywords | 1 | CG-AL-M021 |
|
Description: The model used 'Key' as a variable name or identifier in multiple places throughout the generated code. In AL, 'key' is a reserved keyword (used in table key definitions). When used as a variable name, it causes syntax errors (AL0519: 'Key' is not valid value in this context, and AL0105: identifier expected; 'key' is a keyword). The model should have used a different variable name such as 'KeyName', 'PropertyKey', 'JsonKey', or quoted the identifier. This is a common AL knowledge gap where the model doesn't recognize AL reserved words and uses them as identifiers.
Correct Pattern:
Incorrect Pattern:
Error Codes: AL0519 |
||||