Skip to content

Test-Code-Reviewer-Comments#9607

Open
Alexander-Ya wants to merge 1 commit into
mainfrom
bugs/Test-Code-Reviewer-Comments
Open

Test-Code-Reviewer-Comments#9607
Alexander-Ya wants to merge 1 commit into
mainfrom
bugs/Test-Code-Reviewer-Comments

Conversation

@Alexander-Ya

@Alexander-Ya Alexander-Ya commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What & why

Linked work

Fixes #

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)

Risk & compatibility

@Alexander-Ya
Alexander-Ya requested a review from a team July 20, 2026 17:39
@Alexander-Ya
Alexander-Ya requested a review from Copilot July 20, 2026 17:40
@github-actions github-actions Bot added the Finance GitHub request for Finance area label Jul 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Could not find a linked ADO work item. Please link one by using the pattern 'AB#' followed by the relevant work item number. You may use the 'Fixes' keyword to automatically resolve the work item when the pull request is merged. E.g. 'Fixes AB#1234'

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the Spanish (ES) localization of G/L Entry by moving the ES-specific "Bill No." field out of the localized table definition and into a dedicated tableextension, while also adjusting related table logic.

Changes:

  • Added ES-local tableextension for G/L Entry introducing field "Bill No." with DataClassification = CustomerContent.
  • Removed "Bill No." from the ES localized table 17 "G/L Entry" definition and adjusted a related key definition.
  • Modified CopyFromDeferralPostBuffer and its OnAfterCopyFromDeferralPostBuffer IntegrationEvent signature.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/Layers/ES/BaseApp/Local/Finance/GeneralLedger/Ledger/GLEntryES.TableExt.al Introduces ES-specific tableextension for G/L Entry, adding "Bill No." as an extension field.
src/Layers/ES/BaseApp/Finance/GeneralLedger/Ledger/GLEntry.Table.al Removes "Bill No." from the localized table definition and adjusts related logic/event surface.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1057 to 1060
"IC Partner Code" := GenJnlLine."IC Partner Code";
"Prod. Order No." := GenJnlLine."Prod. Order No.";
"Bill No." := GenJnlLine."Bill No.";

OnAfterCopyGLEntryFromGenJnlLine(Rec, GenJnlLine);
Comment on lines 1155 to 1171
@@ -1170,7 +1167,7 @@
"Tax Group Code" := DeferralPostBuffer."Tax Group Code";
"Use Tax" := DeferralPostBuffer."Use Tax";

OnAfterCopyFromDeferralPostBuffer(Rec, DeferralPostBuffer);
OnAfterCopyFromDeferralPostBuffer(Rec, DeferralPostBuffer, Test);
end;
Comment on lines 1212 to 1222
/// <summary>
/// Integration event raised after copying G/L entry values from deferral posting buffer.
/// Enables extensions to modify G/L entry fields during deferral posting.
/// </summary>
/// <param name="GLEntry">G/L entry being updated</param>
/// <param name="DeferralPostingBuffer">Source deferral posting buffer</param>
/// <param name="Test">Test flag</param>
[IntegrationEvent(false, false)]
local procedure OnAfterCopyFromDeferralPostBuffer(var GLEntry: Record "G/L Entry"; DeferralPostingBuffer: Record "Deferral Posting Buffer")
local procedure OnAfterCopyFromDeferralPostBuffer(var GLEntry: Record "G/L Entry"; DeferralPostingBuffer: Record "Deferral Posting Buffer"; Test: Boolean)
begin
end;
{
}
key(Key13; "G/L Account No.", "Document No.", "Bill No.")
key(Key13; "G/L Account No.", "Document No.")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟠\ High\ Severity\ —\ Breaking\ Changes}$

Field 7000000 "Bill No." is deleted outright from the shipped base-app table "G/L Entry" (table 17) instead of being staged through ObsoleteState. This field has existed since early NAV/ES sync commits, so it is a released, shipped field with persisted customer data. Deleting it (and its use in key(Key13; "G/L Account No.", "Document No.", "Bill No.")) removes the on-disk column and its data with no ObsoleteState=Pending/Removed staging, no ObsoleteReason/ObsoleteTag, and no upgrade code to migrate the stored values into the new tableextension field of the same ID. Re-adding a field under the same ID 7000000 via a table extension is not an established/supported migration path and is not guaranteed to preserve existing data across the upgrade.

Knowledge:

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

/// <param name="Test">Test flag</param>
[IntegrationEvent(false, false)]
local procedure OnAfterCopyFromDeferralPostBuffer(var GLEntry: Record "G/L Entry"; DeferralPostingBuffer: Record "Deferral Posting Buffer")
local procedure OnAfterCopyFromDeferralPostBuffer(var GLEntry: Record "G/L Entry"; DeferralPostingBuffer: Record "Deferral Posting Buffer"; Test: Boolean)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Events}$

CopyFromDeferralPostBuffer declares a local variable Test: Boolean that is never assigned any value (always defaults to false) and is passed only to raise the new OnAfterCopyFromDeferralPostBuffer event parameter, also named Test. The name and the fact that it carries no computed value strongly suggest leftover debug/placeholder code rather than an intentional API addition. Publishing an event parameter with a non-descriptive name and no real semantics permanently pollutes the (local) event's public signature for subscribers with no actual capability. If a genuine capability is intended, name the parameter for what it represents and populate it meaningfully before publishing; otherwise remove it and the unused variable. Note: because the publisher is local, adding this parameter itself does not break existing subscribers (they bind by name and can ignore it), so the real defect is the meaningless placeholder rather than the addition of a parameter.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

namespace Microsoft.Finance.GeneralLedger.Ledger;

tableextension 7000017 "G/L Entry ES" extends "G/L Entry"
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Upgrade}$

"Bill No." is removed from table 17 "G/L Entry" and the line that populated it during posting ("Bill No." := GenJnlLine."Bill No." in CopyGLEntryFromGenJnlLine) is deleted, but no upgrade code migrates existing persisted values into the new tableextension field "G/L Entry ES"."Bill No." (same ID 7000000), and no event subscriber is added anywhere in the repository to repopulate it from GenJnlLine during posting going forward (confirmed: no subscriber to OnAfterCopyGLEntryFromGenJnlLine exists for G/L Entry in the ES layer). "Bill No." is still read elsewhere (e.g. ReversalEntry.Table.al, GeneralLedgerEntries.Page.al), so after this change it will silently be blank for all newly posted G/L entries, and any pre-existing data in the column is at risk during the underlying schema change. This is real impact would normally be major/blocker; it is capped to minor here per agent-finding rules pending a knowledge-backed rule or a fix that (a) migrates existing data and (b) restores population of the field via a subscriber in the ES tableextension/codeunit.

Agent judgement — not directly backed by a BCQuality knowledge article.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.12.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants