Skip to content

Extract NL customization to object extensions (TrMode) - #8933

Open
Alexander Yakunin (Alexander-Ya) wants to merge 53 commits into
mainfrom
bugs/Extract-NL-customization-to-object-extensions-v2
Open

Extract NL customization to object extensions (TrMode)#8933
Alexander Yakunin (Alexander-Ya) wants to merge 53 commits into
mainfrom
bugs/Extract-NL-customization-to-object-extensions-v2

Conversation

@Alexander-Ya

@Alexander-Ya Alexander Yakunin (Alexander-Ya) commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What & why

Linked work

Fixes AB#640601

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

Copy link
Copy Markdown
Contributor Author

Fixes AB#640601

Comment thread src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorNL.TableExt.al
Comment thread src/Layers/NL/BaseApp/Local/Purchases/Vendor/VendorNL.TableExt.al
Comment thread src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.TableExt.al
@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 17 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Accessibility 1 1 0 0 0
Breaking Changes 2 2 0 2 0

Totals: 3 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (2 file(s) excluded)

  • layer-disabled (knowledge) : 2 file(s)

Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives.

Jesper Schulz-Wedde (JesperSchulz) pushed a commit that referenced this pull request Jun 30, 2026
The model-reported anchor for a single-line suggestion can be off by more
than 8 lines (e.g. PR #8933 VendorNL Confirm() was off by 10, label rename
off by 9). Widen the search window to 40 lines either side so the correct
target within the same procedure is considered, while the 0.5 similarity
floor and 0.1 ambiguity margin keep an unrelated look-alike from winning.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jesper Schulz-Wedde (JesperSchulz) pushed a commit that referenced this pull request Jun 30, 2026
Widening the search window exposed a precision problem: a label-rename
suggestion whose added Comment text echoes the field captions at the
Error()/Confirm() call site would re-anchor onto the call site (PR #8933
GenJournalLineNL/GeneralLedgerSetupNL 'Text1000000/1' findings), which is
worse than the original mis-anchor.

Raise the similarity floor to 0.6 and use a bounded window (20). Genuine
edit targets - an edited statement or a renamed declaration - score
~0.75-0.99 and re-anchor confidently (the PR #8933 Confirm() findings and
the PartnerTypeMismatchMsg->Qst rename now land on the right line). Lower-
confidence look-alikes stay below the floor and are suppressed, so the
caller posts a manual snippet instead of a wrong auto-applicable anchor.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment was marked as resolved.

Comment thread src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.TableExt.al Outdated
Comment thread src/Layers/NL/BaseApp/Local/Sales/Customer/CustomerNL.TableExt.al
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 1, 2026
Comment thread src/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al
@@ -10374,6 +10375,11 @@ table 36 "Sales Header"
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterValidateBillToCustomerPaymentFields(var SalesHeader: Record "Sales Header")

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}$

The new publisher OnAfterValidateBillToCustomerPaymentFields is raised inside the "Bill-to Customer No." validation flow, but its name omits the host trigger and reads like a boundary event for a standalone routine. Rename it to the existing OnValidateBillToCustomerNoOn... pattern so subscribers can see it fires mid-validation after the payment fields validate. This same name is copied into every touched SalesHeader.Table.al layer file.

Knowledge:

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

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 10

Recommendation: Request Changes

What this PR does

This PR continues moving NL Transaction Mode and related local behavior out of full objects and into object extensions. Since round 9, the new commits add role-center action images and tooltips, reorder one key to clear an analyzer warning, and remove a duplicate Image property.

Those latest changes look mechanical and do not introduce a new code issue in the reviewed hunks. They also do not change the remaining Transaction Mode copy and validation paths, the disabled W1 service test, or the sales prepayment subscriber signature, so the main merge blockers remain open.

Status of previous suggestions
ID Title Status Author response
S1 Keep the G/L Account field id stable Addressed Still addressed. G/L Account.Omit Default Descr. in Jnl. remains field 11400.
S2 Update the matching role center tooltip Addressed Still addressed for the action that was changed together with the caption.
S3 Add coverage for Transaction Mode wiring Not addressed No active test was added for Transaction Mode copy, validation, prepayment posting, or company scoping.
S4 Keep abbreviated tooltip text where the caption is abbreviated Not addressed The same kind of caption and tooltip mismatch still exists in other changed role centers, for example Gen. Business Posting Groups with tooltip text that says General Business Posting Groups.
S5 Scope all Transaction Mode effects Not addressed The sales, purchase, general journal, and prepayment subscribers still copy or validate Transaction Mode without the Dutch-company guard used by the table field validations.
S6 Do not disable unrelated W1 tests Not addressed PullServiceLineNoShipmentUsingUseFilter is still disabled.
S7 Fix the sales prepayment subscriber signature Not addressed SalesPostPrepaymentNL.Codeunit.al still subscribes to OnBeforePostCustomerEntry with only GenJnlLine and SalesHeader, while the publisher has intermediate parameters before SalesHeader.
S8 Keep the vendor bank event signature Not addressed The event still includes the added Vendor parameter. Re-evaluation keeps this as additive for an event publisher, so it is not treated as a blocker.
New observations (commits since round 9)

None - the commits since round 9 only adjust action metadata, key order, and a duplicate property. No new PR-owned issue was found after checking those hunks against the net PR diff.

Risk assessment and necessity

Risk: The new round-10 changes are low risk, but the open PR risk remains behavior leakage during a refactor that should preserve NL behavior. Unguarded subscribers can still write Transaction Mode values in companies where the field validations would exit, and the sales prepayment subscriber still does not match the publisher shape that supplies the needed sales header.

Necessity: Moving NL-specific Transaction Mode behavior into object extensions is still the right direction for reducing full-object deltas. The PR is still not safe to merge until the open behavior, signature, and test-state gaps are resolved.

---> [AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=8933 round=10 by=alexei-dobriansky at=2026-08-31T13:30:13Z lastSha=064fd842f9cda2623eb3bc57c0792ce121b1f066 reviewKey=5265ef4da63faee5c0b531b071cc6f549e36679cbab2ed944f28106334c6ab9e suggestions=S1@8ec636aa:addressed,S2@f3837858:addressed,S3@6881603a:notaddressed,S4@237a553a:notaddressed,S5@4116b6a1:notaddressed,S6@2520bcaa:notaddressed,S7@dfd0ab17:notaddressed,S8@98126d5b:notaddressed parentRound=9

Comment thread src/Layers/W1/BaseApp/HumanResources/Employee/Employee.Table.al
Comment thread src/Layers/W1/BaseApp/HumanResources/Employee/Employee.Table.al
Comment thread src/Layers/W1/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
Comment thread src/Layers/W1/BaseApp/Sales/Customer/CustomerBankAccount.Table.al
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 11

Recommendation: Request Changes

What this PR does

This PR continues moving NL Transaction Mode and related local behavior out of full objects and into object extensions. Since round 10, the new commit only fixes analyzer warnings by reordering FlowField filters, adding a label comment, and wrapping FieldCaption(...) values in CopyStr(..., 1, 250) before passing them to text parameters.

Those latest changes look mechanical and do not introduce a new issue in the reviewed hunks. They also do not change the remaining Transaction Mode copy and validation paths, the disabled W1 service test, or the sales prepayment subscriber signature, so the main merge blockers remain open.

Status of previous suggestions
ID Title Status Author response
S1 Keep the G/L Account field id stable Addressed Still addressed. G/L Account.Omit Default Descr. in Jnl. remains field 11400.
S2 Update the matching role center tooltip Addressed Still addressed for the action that was changed together with the caption.
S3 Add coverage for Transaction Mode wiring Not addressed No active test was added for Transaction Mode copy, validation, prepayment posting, or company scoping.
S4 Keep abbreviated tooltip text where the caption is abbreviated Not addressed The caption and tooltip mismatch still exists, for example Gen. Business Posting Groups with tooltip text that says General Business Posting Groups.
S5 Scope all Transaction Mode effects Not addressed The sales, purchase, general journal, and prepayment subscribers still copy or validate Transaction Mode without the Dutch-company guard used by the table field validations.
S6 Do not disable unrelated W1 tests Not addressed PullServiceLineNoShipmentUsingUseFilter is still disabled with // [Test].
S7 Fix the sales prepayment subscriber signature Not addressed SalesPostPrepaymentNL.Codeunit.al still subscribes to OnBeforePostCustomerEntry with only GenJnlLine and SalesHeader, while the publisher has intermediate parameters before SalesHeader.
S8 Keep the vendor bank event signature Not addressed The event still includes the added Vendor parameter. This remains additive for an event publisher, so it is not treated as a blocker.
New observations (commits since round 10)

None - the commit since round 10 only addresses warning-shaped issues in FlowField filter order, label comments, and text-length conversion. No new PR-owned issue was found after checking those hunks against the net PR diff.

Risk assessment and necessity

Risk: The new round-11 changes are low risk, but the open PR risk remains behavior leakage during a refactor that should preserve NL behavior. Unguarded subscribers can still write Transaction Mode values in companies where the field validations would exit, and the sales prepayment subscriber still does not match the publisher shape that supplies the needed sales header.

Necessity: Moving NL-specific Transaction Mode behavior into object extensions is still the right direction for reducing full-object deltas. The PR is still not safe to merge until the open behavior, signature, and test-state gaps are resolved.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=8933 round=11 by=alexei-dobriansky at=2026-09-01T13:19:14Z lastSha=fe2eebdb1278f7803aa537aee61bc29751e1e0df reviewKey=719d9a4bc200f70ed5c768bb98d087188d325c33d8f09242691cd0a0d9980e69 suggestions=S1@8ec636aa:addressed,S2@f3837858:addressed,S3@6881603a:notaddressed,S4@237a553a:notaddressed,S5@4116b6a1:notaddressed,S6@2520bcaa:notaddressed,S7@dfd0ab17:notaddressed,S8@98126d5b:notaddressed parentRound=10

trigger OnValidate()
begin
if "Local Currency" = "Local Currency"::Euro then
Error(

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\ —\ Error\ Handling}$

This OnValidate check already knows the only valid recovery when "Local Currency" is Euro: clear "Currency Euro". Raising a plain Error leaves the user with a dead-end validation dialog; use an ErrorInfo with a Fix-it AddAction that clears the field, and include Title/Message/DetailedMessage so the recoverable failure offers the known remedy.

Knowledge:

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

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 12

Recommendation: Request Changes

What this PR does

This PR continues moving NL Transaction Mode and related local behavior out of full objects and into object extensions. Since round 11, the only new commit reindents the Payments in Process FlowField filters in EmployeeLedgerEntryNL.TableExt.al to satisfy a warning.

The latest change is mechanical and does not introduce a new issue in the reviewed hunk. It also does not touch the remaining Transaction Mode copy and validation paths, the disabled W1 service test, the role-center tooltip mismatch, or the sales prepayment subscriber signature, so the main blockers remain open.

Status of previous suggestions
ID Title Status Author response
S1 Keep the G/L Account field id stable Addressed Still addressed. G/L Account.Omit Default Descr. in Jnl. remains field 11400.
S2 Update the matching role center tooltip Addressed Still addressed for the action that was changed together with the caption.
S3 Add coverage for Transaction Mode wiring Not addressed No active test was added for Transaction Mode copy, validation, prepayment posting, or company scoping.
S4 Keep abbreviated tooltip text where the caption is abbreviated Not addressed The caption and tooltip mismatch still exists, for example Gen. Business Posting Groups with tooltip text that says General Business Posting Groups.
S5 Scope all Transaction Mode effects Not addressed The sales, purchase, general journal, and prepayment subscribers still copy or validate Transaction Mode without the Dutch-company guard used by the table field validations.
S6 Do not disable unrelated W1 tests Not addressed PullServiceLineNoShipmentUsingUseFilter is still disabled with // [Test].
S7 Fix the sales prepayment subscriber signature Not addressed SalesPostPrepaymentNL.Codeunit.al still subscribes to OnBeforePostCustomerEntry with only GenJnlLine and SalesHeader, while the publisher has intermediate parameters before SalesHeader.
S8 Keep the vendor bank event signature Not addressed The event still includes the added Vendor parameter. This remains additive for an event publisher, so it is not treated as a blocker.
New observations (commits since round 11)

None - the commit since round 11 only adjusts FlowField filter indentation in EmployeeLedgerEntryNL.TableExt.al. The changed span is in the net PR diff and does not add a new issue.

Risk assessment and necessity

Risk: The new round-12 change is low risk, but the open PR risk remains behavior leakage during a refactor that should preserve NL behavior. Unguarded subscribers can still write Transaction Mode values in companies where the field validations would exit, and the sales prepayment subscriber still does not match the publisher shape that supplies the needed sales header.

Necessity: Moving NL-specific Transaction Mode behavior into object extensions is still the right direction for reducing full-object deltas. The PR is still not safe to merge until the open behavior, signature, and test-state gaps are resolved.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=8933 round=12 by=alexei-dobriansky at=2026-09-02T13:19:46Z lastSha=45384da37d0e1a5e792dfd320e4cc79f2b74776e reviewKey=7b9d202cbf0102c4f78e2c22ef099c4076df5ceca7a6af65af957de7529d2f16 suggestions=S1@8ec636aa:addressed,S2@f3837858:addressed,S3@6881603a:notaddressed,S4@237a553a:notaddressed,S5@4116b6a1:notaddressed,S6@2520bcaa:notaddressed,S7@dfd0ab17:notaddressed,S8@98126d5b:notaddressed parentRound=11

@alexei-dobriansky

alexei-dobriansky commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 13

Recommendation: Request Changes

What this PR does

This PR continues moving NL Transaction Mode behavior and related local objects out of full objects and into object extensions. Since round 12, the only author-owned commit adds #pragma warning disable/restore AA0232 around three Payments in Process FlowFields.

The latest change is present in the net PR diff and is limited to analyzer-warning suppression around existing FlowField formulas. It does not add a new issue, but it also does not change the remaining Transaction Mode copy and validation paths, the disabled W1 service test, the role-center tooltip mismatch, or the sales prepayment subscriber signature.

Status of previous suggestions
ID Title Status Author response
S1 Keep the G/L Account field id stable Addressed Still addressed. G/L Account.Omit Default Descr. in Jnl. remains field 11400.
S2 Update the matching role center tooltip Addressed Still addressed for the action that was changed together with the caption.
S3 Add coverage for Transaction Mode wiring Not addressed No active test was added for Transaction Mode copy, validation, prepayment posting, or company scoping.
S4 Keep abbreviated tooltip text where the caption is abbreviated Not addressed The caption and tooltip mismatch still exists, for example Gen. Business Posting Groups with tooltip text that says General Business Posting Groups.
S5 Scope all Transaction Mode effects Not addressed The sales, purchase, general journal, and prepayment subscribers still copy or validate Transaction Mode without the Dutch-company guard used by the table field validations.
S6 Do not disable unrelated W1 tests Not addressed PullServiceLineNoShipmentUsingUseFilter is still disabled with // [Test].
S7 Fix the sales prepayment subscriber signature Not addressed SalesPostPrepaymentNL.Codeunit.al still subscribes to OnBeforePostCustomerEntry with only GenJnlLine and SalesHeader, while the publisher has intermediate parameters before SalesHeader.
S8 Keep the vendor bank event signature Not addressed The event still includes the added Vendor parameter. This remains additive for an event publisher, so it is not treated as a blocker.
New observations (commits since round 12)

None - the commit since round 12 only suppresses AA0232 around three Payments in Process FlowFields. The changed spans are in the net PR diff and do not add a new issue.

Risk assessment and necessity

Risk: The new round-13 change is low risk, but the open PR risk remains behavior leakage during a refactor that should preserve NL behavior. Unguarded subscribers can still write Transaction Mode values in companies where the field validations would exit, and the sales prepayment subscriber still does not match the publisher shape that supplies the needed sales header.

Necessity: Moving NL-specific Transaction Mode behavior into object extensions is still the right direction for reducing full-object deltas. The PR is still not safe to merge until the open behavior, signature, and test-state gaps are resolved.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=8933 round=13 by=alexei-dobriansky at=2026-09-05T13:31:34Z lastSha=cc292bf284243f7cef37c8a6c7447363b88d941d reviewKey=f35e4dac2d84e17648eb5eb343a8f850eab97ce365315308dc139a16aecf0033 suggestions=S1@8ec636aa:addressed,S2@f3837858:addressed,S3@6881603a:notaddressed,S4@237a553a:notaddressed,S5@4116b6a1:notaddressed,S6@2520bcaa:notaddressed,S7@dfd0ab17:notaddressed,S8@98126d5b:notaddressed parentRound=12

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 14

Recommendation: Request Changes

What this PR does

This PR continues moving NL Transaction Mode behavior and related local objects out of full objects and into object extensions. Since round 13, the only author-owned commit changes the Employee Ledger Entry NL secondary key to include Open before Transaction Mode Code.

The new key change is present in the net PR diff and matches the shape needed for open-entry lookups. It does not add a new issue, but it also does not change the remaining Transaction Mode copy and validation paths, the disabled W1 service test, the role-center tooltip mismatch, or the sales prepayment subscriber signature.

Status of previous suggestions
ID Title Status Author response
S1 Keep the G/L Account field id stable Addressed Still addressed. G/L Account.Omit Default Descr. in Jnl. remains field 11400.
S2 Update the matching role center tooltip Addressed Still addressed for the action that was changed together with the caption.
S3 Add coverage for Transaction Mode wiring Not addressed No active test was added for Transaction Mode copy, validation, prepayment posting, or company scoping.
S4 Keep abbreviated tooltip text where the caption is abbreviated Not addressed The caption and tooltip mismatch still exists, for example Gen. Business Posting Groups with tooltip text that says General Business Posting Groups.
S5 Scope all Transaction Mode effects Not addressed The sales, purchase, general journal, and prepayment subscribers still copy or validate Transaction Mode without the Dutch-company guard used by the table field validations.
S6 Do not disable unrelated W1 tests Not addressed PullServiceLineNoShipmentUsingUseFilter is still disabled with // [Test].
S7 Fix the sales prepayment subscriber signature Not addressed SalesPostPrepaymentNL.Codeunit.al still subscribes to OnBeforePostCustomerEntry with only GenJnlLine and SalesHeader, while the publisher has intermediate parameters before SalesHeader.
S8 Keep the vendor bank event signature Not addressed The event still includes the added Vendor parameter. This remains additive for an event publisher, so it is not treated as a blocker.
New observations (commits since round 13)

None - the commit since round 13 only adds Open to the Employee Ledger Entry NL TransactionMode key. The changed span is in the net PR diff and does not add a new issue.

Risk assessment and necessity

Risk: The new key change is low risk and improves the moved Employee Ledger Entry extension. The open PR risk remains behavior leakage during a refactor that should preserve NL behavior: unguarded subscribers can still write Transaction Mode values in companies where the field validations would exit, and the sales prepayment subscriber still does not match the publisher shape that supplies the needed sales header.

Necessity: Moving NL-specific Transaction Mode behavior into object extensions is still the right direction for reducing full-object deltas. The PR is still not safe to merge until the open behavior, signature, and test-state gaps are resolved.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=8933 round=14 by=alexei-dobriansky at=2026-09-05T19:15:17Z lastSha=1c00f1ab03b0a7a8fa14d733ef54e78900670f1e reviewKey=bc1d8b90ee68922603871cd810e39a94c1d03b2ecbbb01b05bdf07c6ff180381 suggestions=S1@8ec636aa:addressed,S2@f3837858:addressed,S3@6881603a:notaddressed,S4@237a553a:notaddressed,S5@4116b6a1:notaddressed,S6@2520bcaa:notaddressed,S7@dfd0ab17:notaddressed,S8@98126d5b:notaddressed parentRound=13

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

Labels

Delocalization Extracting from country layers and converting local functionality to app Team: Finance GitHub request for Finance area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants