Bug 648577: [29.0] Subcontracting migration does not precheck bin-mandatory locations - #11647
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 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 fitFit: 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. SuggestionsNone. Risk assessment and necessityRisk: 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.
|
Backport of #11001 to
releases/29.0.What
Tests
AB#648577