Skip to content

Bug 624295: [Subcontracting] Prevent Transfer type on Non-Inventory items#8220

Open
ChethanT wants to merge 3 commits into
mainfrom
bugs/Subcontracting/624295-NonInventoryTransferValidation
Open

Bug 624295: [Subcontracting] Prevent Transfer type on Non-Inventory items#8220
ChethanT wants to merge 3 commits into
mainfrom
bugs/Subcontracting/624295-NonInventoryTransferValidation

Conversation

@ChethanT
Copy link
Copy Markdown
Contributor

@ChethanT ChethanT commented May 20, 2026

Problem

Setting Subcontracting Type = Transfer on 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:

Type must be equal to 'Inventory' in Item: No.=SP-BOM1110. Current value is 'Non-Inventory'.

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 Type field in:

  • Production BOM Line (tableext 99001531)
  • Prod. Order Component (tableext 99001502)
  • Planning Component (tableext 99001503)

When setting Subcontracting Type to Transfer, the item's Type is checked via Item.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:

  • Non-Inventory item cannot be set to Transfer on Prod BOM Line (error)
  • Inventory item can be set to Transfer on Prod BOM Line (success)
  • Non-Inventory item cannot be set to Transfer on Prod Order Component (error)
  • Non-Inventory item can be set to Purchase on Prod BOM Line (success, not blocked)

Fixes AB#624295

… (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>
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label May 20, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone May 20, 2026
@ChethanT ChethanT changed the title [Subcontracting] Prevent Transfer type on Non-Inventory items (bug 624295) Bug 624295: [Subcontracting] Prevent Transfer type on Non-Inventory items May 20, 2026
@ChethanT ChethanT marked this pull request as ready for review May 22, 2026 07:05
@ChethanT ChethanT requested a review from a team as a code owner May 22, 2026 07:05
@ChethanT ChethanT enabled auto-merge (squash) May 22, 2026 07:05
@ChethanT ChethanT added the Subcontracting Subcontracting related activities label May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Subcontracting Subcontracting related activities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant