Skip to content

[Subcontracting] Removing dead code from subcontracting.#8712

Draft
6CRIPT wants to merge 3 commits into
mainfrom
bugs/638466-subcontracing-dead-code
Draft

[Subcontracting] Removing dead code from subcontracting.#8712
6CRIPT wants to merge 3 commits into
mainfrom
bugs/638466-subcontracing-dead-code

Conversation

@6CRIPT

@6CRIPT 6CRIPT commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#638466

…rs (bug 638466)

The 'Source Subtype' field (99001535) on Transfer Header, Transfer Shipment
Header and Transfer Receipt Header was only ever written/filtered with value
'2' (Vendor), making the Customer ('1') and Item ('3') branches of
HandleSubcontractingSourceLookup dead code and the field itself redundant
with 'Subc. Source Type' = Subcontracting.

Removes the field, drops it from key Key99001501, simplifies the lookup to
Vendor-only, and removes all writes/filters/copies/page controls referencing
it. Mirrors the fix for Direct Trans. Header (bug 617373). Adds a regression
test verifying Source Type and Source ID still propagate to the posted
Transfer Shipment Header.
@6CRIPT 6CRIPT requested a review from a team June 22, 2026 09:55
@6CRIPT 6CRIPT self-assigned this Jun 22, 2026
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jun 22, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 22, 2026
@github-actions

This comment was marked as resolved.

@github-actions

This comment was marked as low quality.

@github-actions

This comment was marked as low quality.

@github-actions

This comment was marked as low quality.

@github-actions

This comment was marked as low quality.

6CRIPT added 2 commits June 22, 2026 12:55
…eation reports (PR 8712 review)

Make the duplicate-check queries in Subc. Create Transf. Order and
Subc. Create SubCReturnOrder explicitly filter on
'Subc. Source Type' = Subcontracting after removing the redundant
'Source Subtype' filter. The queries were already scoped to subcontracting
records (via 'Subcontr. Purch. Order No.' / 'Subc. Return Order'), but the
explicit filter documents intent, aligns with Subc. Synchronize Management
and lets the query use key Key99001501.
…Header (PR 8712 review)

The regression test only asserted source-field propagation on the Transfer
Shipment Header, leaving the parallel change in Subc. Trans Rcpt Header Ext
uncovered. Post the inbound receipt leg as well and assert that
'Subc. Source Type' and 'Source ID' are propagated to the Transfer Receipt
Header. Renamed the test to reflect that it now covers both posted headers.
@github-actions

Copy link
Copy Markdown
Contributor

$\textbf{🟠\ High\ Severity\ —\ Upgrade} \quad \color{gray}{\texttt{\small Iteration\ 1}}$

Field removed without obsolete deprecation lifecycle

Field "Source Subtype" (ID 99001535) is directly deleted from three table extensions (SubcTransferHeader, SubcTransRcptHeaderExt, SubcTransShptHeaderExt) without first going through the required Business Central deprecation lifecycle. Any per-tenant or partner extension that references "Source Subtype" on these tables will fail to compile after the upgrade.

Recommendation:

  • Follow the BC deprecation path: first mark the field as ObsoleteState = Pending; ObsoleteReason = '...; ObsoleteTag = '...' in one release, then ObsoleteState = Removed in a subsequent release, and only physically delete the field after the removed state has shipped. Also consider adding an upgrade codeunit to null out or migrate any existing values stored in the column.
field(99001535; "Source Subtype"; Option)
{
    Caption = 'Source Subtype';
    DataClassification = CustomerContent;
    OptionCaption = '0,1,2,3,4,5,6,7,8,9,10';
    OptionMembers = "0","1","2","3","4","5","6","7","8","9","10";
    ObsoleteState = Pending;
    ObsoleteReason = 'Use "Subc. Source Type" instead.';
    ObsoleteTag = '<NextVersion>';
}

Line mapping was unavailable, so this was posted as an issue comment.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why

@6CRIPT 6CRIPT marked this pull request as draft June 22, 2026 12:03
@6CRIPT 6CRIPT changed the title [Subcontracting] Remove dead Source Subtype field from Transfer headers [Subcontracting] Removing dead code from subcontracting. Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant