Extract AU Withholding Tax code#9258
Conversation
|
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 PR ReviewIteration 4 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 0 knowledge-backed · 1 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
This PR deletes the 'WHT Business Posting Group', 'WHT Product Posting Group', 'WHT Absorb Base', 'Skip WHT', 'Actual Vendor No.', 'Is WHT', and related WHT fields outright from base APAC tables that hold existing customer data (G/L Account, Gen.Journal Line, Posted Gen. Journal Line, Invoice Posting Buffer, Purchase Header/Line, Purch. Inv. Header/Line, Purch. Cr. Memo Hdr./Line, Purch. Rcpt. Header, Return Shipment Header, Purchase Header Archive, Vendor, Vendor Templ.) instead of staging the retirement with ObsoleteState = Pending (with ObsoleteReason and ObsoleteTag) and following up with a Removed stage plus an upgrade procedure. The fields are re-declared with the same field IDs via new table extensions, which preserves data only for tenants where the base-table deletion and the extension addition are published together in the exact same deployment. For most of the affected tables the replacement extension is co-located in the same APAC layer (e.g. WHTPurchaseLine.TableExt.al, WHTVendor.TableExt.al), so data continuity is likely intact there. However, for G/L Account, Gen. Journal Line, Posted Gen. Journal Line, and Invoice Posting Buffer the replacement fields were placed in an AU-only extension (src/Layers/AU/BaseApp/Local/WHT/*.TableExt.al) while the field was deleted from the shared APAC layer. Any tenant on a non-AU APAC-based country (for example NZ, whose layer config extends APAC directly without AU) will simply lose these fields and their stored WHT configuration permanently, with no migration path. Recommendation:
Knowledge:
Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
| [IntegrationEvent(true, false)] | ||
| [Scope('OnPrem')] | ||
| procedure OnGenJnlLineGetVendorAccount(Vendor: Record Vendor) | ||
| procedure OnGenJnlLineGetVendorAccount(Vendor: Record Vendor; var Rec: Record "Gen. Journal Line") |
There was a problem hiding this comment.
OnGenJnlLineGetVendorAccount is an existing published [IntegrationEvent] (Scope('OnPrem')) whose signature is changed from a single 'Vendor: Record Vendor' parameter to '(Vendor: Record Vendor; var Rec: Record "Gen.
Journal Line")'. Widening a shipped publisher's signature is a breaking change for the extensibility contract: any existing extension already subscribing against the original one-parameter contract may not receive or expect the new mutable 'Rec' argument, and the semantics of 'Skip WHT' now being set via this event are invisible to callers written against the old contract. This is a cross-cutting API-compatibility concern (touches upgrade/extensibility and architecture, not a single leaf domain), so it is capped to minor per agent-finding policy even though the underlying impact on shipped extensibility surface is normally major-to-blocker.
Recommendation:
- add a new event instead of mutating the existing publisher's signature, or stage the change through ObsoleteState/Reason/Tag on the old event before removal.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
| { | ||
| } | ||
| key(Key15; "Document Type", "Document No.", "WHT Business Posting Group", "WHT Product Posting Group") | ||
| key(Key15; "Document Type", "Document No.") |
There was a problem hiding this comment.
Key15 on Purchase Line previously was ("Document Type", "Document No.", "WHT Business Posting Group", "WHT Product Posting Group").
The PR relocates the two WHT fields to the WHTPurchaseLine table extension but redefines Key15 as just ("Document Type", "Document No."), dropping the WHT fields from the key entirely rather than re-declaring an equivalent key in the extension. Any lookup or sort that filtered/sorted on the WHT posting groups now has no covering index and falls back to a wider read or in-memory sort, per the referenced guidance on matching keys to filter/sort requirements.
Knowledge:
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why
Same pattern a third time: Key4 ("Document No.", "WHT Business Posting Group", "WHT Product Posting Group") is deleted from Purch.Cr. Memo Line and the paired WHTPurchCrMemoLine table extension does not re-declare an equivalent key, dropping index coverage for the WHT posting-group fields. Suggested fix (apply manually — could not be anchored as a one-click suggestion): tableextension 28008 WHTPurchCrMemoLine extends "Purch. Cr. Memo Line"
{
fields
{
field(28040; "WHT Business Posting Group"; Code[20])
{
Caption = 'WHT Business Posting Group';
DataClassification = CustomerContent;
TableRelation = "WHT Business Posting Group";
}
field(28041; "WHT Product Posting Group"; Code[20])
{
Caption = 'WHT Product Posting Group';
DataClassification = CustomerContent;
TableRelation = "WHT Product Posting Group";
}
field(28042; "WHT Absorb Base"; Decimal)
{
AutoFormatType = 1;
AutoFormatExpression = GetCurrencyCode();
Caption = 'WHT Absorb Base';
DataClassification = CustomerContent;
}
}
keys
{
key(WHTKey4; "Document No.", "WHT Business Posting Group", "WHT Product Posting Group")
{
}
}
}Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
The same pattern repeats here: Key5 ("Document No.", "WHT Business Posting Group", "WHT Product Posting Group") is deleted from Purch.Inv. Line and the moved WHT fields are not covered by any key in the paired WHTPurchInvLine table extension, losing the index for any access filtering/sorting by these posting groups. Suggested fix (apply manually — could not be anchored as a one-click suggestion): tableextension 28010 WHTPurchInvLine extends "Purch. Inv. Line"
{
fields
{
field(28040; "WHT Business Posting Group"; Code[20])
{
Caption = 'WHT Business Posting Group';
DataClassification = CustomerContent;
TableRelation = "WHT Business Posting Group";
}
field(28041; "WHT Product Posting Group"; Code[20])
{
Caption = 'WHT Product Posting Group';
DataClassification = CustomerContent;
TableRelation = "WHT Product Posting Group";
}
field(28042; "WHT Absorb Base"; Decimal)
{
AutoFormatType = 1;
AutoFormatExpression = '';
Caption = 'WHT Absorb Base';
DataClassification = CustomerContent;
}
}
keys
{
key(WHTKey5; "Document No.", "WHT Business Posting Group", "WHT Product Posting Group")
{
}
}
}Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why |
What & why
Linked work
Fixes #
How I validated this
What I tested and the outcome (required — be specific: scenarios, commands, screenshots for UI changes)
Risk & compatibility