Skip to content

Bug 648577: [29.0] Subcontracting migration does not precheck bin-mandatory locations - #11647

Open
Chethan Thopaiah (ChethanT) wants to merge 1 commit into
releases/29.0from
backport/releases/29.0/11001-20260921
Open

Chethan Thopaiah (ChethanT) wants to merge 1 commit into
releases/29.0from
backport/releases/29.0/11001-20260921

Conversation

@ChethanT

@ChethanT Chethan Thopaiah (ChethanT) commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Backport of #11001 to releases/29.0.

What

  • Block IT subcontracting migration when legacy vendor or purchase-header locations use unsupported warehouse settings.
  • Report every incompatible location and list each enabled setting.
  • Keep migration data untouched when the precheck fails.

Tests

  • Includes the regression coverage from the source PR.

AB#648577

…tory locations (#11001)

## What
- Block IT subcontracting migration when legacy vendor or
purchase-header locations use unsupported warehouse settings.
- Report every incompatible location and list each enabled setting.
- Keep migration data untouched when the precheck fails.

## Why
The migration copied legacy location codes directly into the new
subcontracting fields, bypassing the target validation and leaving
migrated records in an unsupported state.

## Tests
- Added coverage for multiple locations and all unsupported warehouse
settings.
- Added integration coverage proving migration stops before vendor data
is copied.

## Review
- al-review (BCQuality, Branch mode, High): the ErrorBehavior::Collect
precheck now handles its collected errors explicitly and raises a single
deliberate blocking error instead of relying on the platform
concatenated dialog.

ADO bug:
[648577](https://dynamicssmb2.visualstudio.com/Dynamics%20SMB/_workitems/edit/648577)


[AB#648577](https://dynamicssmb2.visualstudio.com/1fcb79e7-ab07-432a-a3c6-6cf5a88ba4a5/_workitems/edit/648577)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the Team: SCM GitHub request for SCM area label Sep 21, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Sep 21, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept

What this PR does

This change adds a subcontracting-location precheck before the IT subcontracting migration copies legacy location codes into the new subcontracting fields. It reports missing locations and unsupported warehouse settings, and it stops migration before data is moved.

The code matches the target field rules: vendor locations block the full unsupported warehouse-handling set, purchase-header-only locations block Bin Mandatory, and in-transit locations are blocked for both through the table relation rule. The check also runs again after table locks, so a concurrent change between the first precheck and migration is still caught before any migration writes happen.

Problem-solution fit

Fit: Strong

The reported bug is that migration can copy legacy subcontracting locations that the new setup would reject. The diff directly addresses that by validating every legacy vendor and purchase-header location before migration, listing the incompatible settings, and preserving the existing data when the check fails.

Suggestions

None.

Risk assessment and necessity

Risk: The touched path is an irreversible IT subcontracting migration that writes Vendor and Purchase Header subcontracting location fields by direct assignment. The locked recheck, Location lock, source-specific validation, in-transit check, and regression tests reduce the main data-integrity risk. No public API, event publisher, Sales/Purchase/Service analogue, or BaseApp event dependency is changed.

Necessity: The change is needed because migration must reject legacy location values that the new subcontracting fields would not accept. The scope is appropriate for the reported bug and remains limited to the migration precheck and its tests.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11647 round=1 by=alexei-dobriansky at=2026-09-21T12:11:16.2456615Z lastSha=036b5cf16567752233b2e5ec097d908ee7b54da6 reviewKey=33243151f11c6cfad7e0b9b543565977ae8633d2d6f50084ceb8dbd658277d37 suggestions=

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

Labels

Team: SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants