Bug 624295: [Subcontracting] Prevent Transfer type on Non-Inventory items#8220
Draft
ChethanT wants to merge 1 commit into
Draft
Bug 624295: [Subcontracting] Prevent Transfer type on Non-Inventory items#8220ChethanT wants to merge 1 commit into
ChethanT wants to merge 1 commit into
Conversation
… (bug 624295) Non-Inventory items cannot be transferred via Transfer Orders, so setting Subcontracting Type = Transfer on them leads to a runtime error when creating the transfer order. This fix adds upfront validation on: - Production BOM Line - Prod. Order Component - Planning Component When setting Subcontracting Type to Transfer, the item's Type is now validated to be Inventory. Other Subcontracting Types (Purchase, InventoryByVendor) remain allowed for Non-Inventory items. Added test codeunit 149916 with 4 tests covering valid and invalid scenarios. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Setting
Subcontracting Type = Transferon a Production BOM Line with a Non-Inventory item (e.g., SP-BOM1110) is allowed, but when the user later tries to create a Transfer Order, it fails with:This is because Transfer Lines require Inventory-type items, but there was no upfront validation preventing the invalid configuration.
Fix
Added validation on the
Subcontracting Typefield in:When setting
Subcontracting TypetoTransfer, the item's Type is checked viaItem.TestField(Type, Item.Type::Inventory). Other Subcontracting Types (Purchase, InventoryByVendor) are still allowed for Non-Inventory items since they don't create Transfer Orders.Testing
New test codeunit 149916 with 4 tests:
Fixes AB#624295