Skip to content

Bug 648577: [29.x] Subcontracting migration does not precheck bin-mandatory locations - #11646

Open
Chethan Thopaiah (ChethanT) wants to merge 1 commit into
releases/29.xfrom
backport/releases/29.x/11001-20260921
Open

Chethan Thopaiah (ChethanT) wants to merge 1 commit into
releases/29.xfrom
backport/releases/29.x/11001-20260921

Conversation

@ChethanT

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

Copy link
Copy Markdown
Contributor

Backport of #11001 to releases/29.x.

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.1 milestone Sep 21, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Accept

What this PR does

This backport adds a precheck before the IT subcontracting migration copies legacy subcontracting location codes into the new fields. It blocks missing locations, unsupported warehouse settings, and in-transit locations, reports all collected location problems, and reruns the authoritative check after table locks are taken and before migration writes data.

The change fits the migration flow. The checked Vendor, Purchase Header, and Location data is read under the same locks used for the migration, and the source-specific rules match the target fields: vendor locations get the stricter warehouse-handling checks, purchase-header-only locations get the Bin Mandatory check, and both reject in-transit locations.

Problem-solution fit

Fit: Strong

The bug says migration must stop before unsupported legacy subcontracting locations are copied into the new setup. The diff addresses that path directly, keeps the failure before data movement, and includes regression coverage for multiple invalid locations, missing locations, source-specific rules, in-transit locations, and the no-data-moved failure path.

Suggestions

None.

Risk assessment and necessity

Risk: The touched path is the one-way IT subcontracting migration for Vendor and Purchase Header subcontracting location fields. An incorrect check could leave migrated data with locations that the new subcontracting fields reject, but this backport matches the accepted source patch, reruns validation under Vendor, Purchase Header, and Location locks, and does not change any public API, event publisher, or BaseApp event dependency.

Necessity: The change is needed because the migration writes the new subcontracting location fields by direct assignment instead of target-field validation. The scope is appropriate for the bug and stays limited to the precheck, locking-safe validation, error aggregation, and regression tests.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11646 round=1 by=alexei-dobriansky at=2026-09-21T12:04:39Z lastSha=ba820c93cde7aaed5f5ec6f79725c78da3cfccfd reviewKey=c47c931f5f889e5f650397f672dcfa16d89dd6e6aeb17257fdd6b242ca40a83a suggestions=none

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