Fix AL0254 compile error in Stock Register for Job Work report - #11154
Merged
Jesper Schulz-Wedde (JesperSchulz) merged 1 commit intoSep 8, 2026
Merged
Conversation
Platform 30.x tightened AL0254 to also flag sorting fields introduced by table extensions. The Purch. Rcpt. Line data item sorts on 'Prod. Order No.' and 'Prod. Order Line No.' (added by the Manufacturing table extension), which have no covering key, so the report now fails to compile. Wrap the DataItemTableView in a scoped '#pragma warning disable/restore AL0254', matching the existing suppression for the Item Ledger Entry sort in the same report. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Maria Zhelezova (mazhelez)
temporarily deployed
to
triage
September 7, 2026 14:07 — with
GitHub Actions
Inactive
Jesper Schulz-Wedde (JesperSchulz)
enabled auto-merge
September 8, 2026 09:12
Jesper Schulz-Wedde (JesperSchulz)
approved these changes
Sep 8, 2026
Miroslav Uhlíř (mirouhl)
approved these changes
Sep 8, 2026
Jesper Schulz-Wedde (JesperSchulz)
deleted the
mazhelez/al0254-stockregister-jobwork
branch
September 8, 2026 12:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Platform 30.x uptake fails to compile
StockRegisterforJobWork.Report.al(GST Subcontracting, IN localization) with two AL0254 errors on line 324:The
Purch. Rcpt. Linedata item sorts on"Prod. Order No."(5401) and"Prod. Order Line No."(99000754). Those fields exist only on the Manufacturing table extensionMfg. Purch. Receipt Line(which extendsPurch. Rcpt. Line) and are not covered by any key on the base table. Recent AL compilers tightened AL0254 to also validate sort fields introduced by a table extension (earlier compilers only checked base-table fields). Combined with AL0254 defaulting to Error (after the globalAL0254 → Warningruleset override was removed in #10878), the report no longer compiles. No app logic changed — this only surfaces under the newer compiler.The fix wraps the
DataItemTableViewsort in a scoped#pragma warning disable/restore AL0254, matching the accepted suppression already used for the Item Ledger Entry sort a few lines above in the same report (added in #10878):A covering key is intentionally not added, since altering a shared base/extension table's keys risks schema and performance changes.
Linked work
AB#649216
How I validated this
What I tested and the outcome
Local build was not performed in this environment (the NAV enlistment initialization requires elevation that isn't available in the current session). The change is a 2-line, comment-annotated
#pragmaidentical in pattern to the existing accepted AL0254 suppression at line 224 of the same report; it only suppresses the diagnostic and does not alter the report's runtime behavior or its sort order. No tests added — this is a compile-only suppression with no behavior change. Please build the app locally and confirm before requesting review; CI on this PR is the safety net.Risk & compatibility
Minimal. Pragma/comment-only change with no functional, schema, or data impact. It suppresses AL0254 for one object-specific sort whose sort fields come from a table extension without a covering key. Follow-up: once the newly-flagged AL0254 sort sites across BCApps are addressed, the AL0254 Error hardening from #10878 can stay in place.