Bug 648577: [29.x] Subcontracting migration does not precheck bin-mandatory locations - #11646
Chethan Thopaiah (ChethanT) wants to merge 1 commit into
Conversation
…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>
Good Sense Reviewer - Round 1Recommendation: AcceptWhat this PR doesThis 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 fitFit: 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. SuggestionsNone. Risk assessment and necessityRisk: 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.
|
Backport of #11001 to
releases/29.x.What
Tests
AB#648577