Skip to content

[Master]Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking." - #9532

Open
sanjmaurya wants to merge 7 commits into
microsoft:mainfrom
sanjmaurya:bugs/Bug-642378-Main-ErrorWhenCreatingPickNothingtohandle
Open

[Master]Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking."#9532
sanjmaurya wants to merge 7 commits into
microsoft:mainfrom
sanjmaurya:bugs/Bug-642378-Main-ErrorWhenCreatingPickNothingtohandle

Conversation

@sanjmaurya

@sanjmaurya sanjmaurya commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Bug 642378: [Master][ALL-E] Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking."

Fixes AB#642378

Issue :- Error when creating a Pick "Nothing to handle. The quantity to be picked is in bin W-09-0002, which is not set up for picking."

Cause :-

The failure is in ValidateQtyPickedInShipmentBin in WarehouseAvailabilityMgt.Codeunit.al:904. It checks the picked-not-shipped quantity only in the location's default Shipment Bin Code (W-09-0001). In the repro (step 7) the shipment bin was changed to W-09-0002, so the default ship bin shows 0 → it wrongly sets QtyPicked := 0. That cascades: QtyReservedOnPickShip becomes 0 while ReservedQtyOnInventory stays 160, so CalcAvailabilityAfterReservationImpact(40, 160, 0, 0) returns max(0, 40 − 160) = 0 → "Nothing to handle."

Solution :-

Replaced the single default-bin check with a new helper CalcQtyOnShipmentBins that sums the item's quantity across all Ship-type bins (any bin whose Bin Type has Ship = true), not just the default one. So the 160 in W-09-0002 is correctly recognized, QtyPicked stays 160, QtyReservedOnPickShip = 160, and availability becomes max(0, 40 − 0) = 40 → the pick for 40 succeeds.

The Bin Mandatory + Shipment Bin Code <> '' guard is kept, so locations without a default shipment bin behave exactly as before. Analyzer/compile is clean.

Note: this is verified by full code tracing, not a live BC run — please rebuild and re-run your exact repro to confirm the pick now creates 40.

@github-actions github-actions Bot added From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item labels Jul 16, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 16, 2026
@JesperSchulz JesperSchulz added the SCM GitHub request for SCM area label Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Stale Status Check Deleted

The Pull Request Build workflow run for this PR was older than 72 hours and has been deleted.

📋 Why was it deleted?

Status checks that are too old may no longer reflect the current state of the target branch. To ensure this PR is validated against the latest code and passes up-to-date checks, a fresh build is required.


🔄 How to trigger a new status check:

  1. 📤 Push a new commit to the PR branch, or
  2. 🔁 Close and reopen the PR

This will automatically trigger a new Pull Request Build workflow run.

@sanjmaurya
sanjmaurya marked this pull request as ready for review July 29, 2026 04:08
@sanjmaurya
sanjmaurya requested a review from a team July 29, 2026 04:08
Comment thread src/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al Outdated
Comment thread src/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al
Comment thread src/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al Outdated
Comment thread src/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al
Comment thread src/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al
Comment thread src/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al
Comment thread src/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al
@github-actions

Copy link
Copy Markdown
Contributor

Could not find linked issues in the pull request description. Please make sure the pull request description contains a line that contains 'Fixes #' followed by the issue number being fixed. Use that pattern for every issue you want to link.

Comment thread src/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al
Comment thread src/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al Outdated
@sanjmaurya sanjmaurya removed their assignment Jul 30, 2026
v-ankitgoyal
v-ankitgoyal previously approved these changes Jul 31, 2026

@PredragMaricic PredragMaricic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

S1 (High): Preserve the existing shipment-bin extensibility contract.

CalcQtyOnShipmentBins manually builds a Ship bin-type filter instead of using CreatePick.GetBinTypeFilter(1), which is already used elsewhere and invokes OnBeforeGetBinTypeFilter. Extensions that customize shipping-bin classification can therefore get inconsistent picked and available quantities. Please reuse the existing extensible filter helper.

S2 (High): Exercise the changed FEFO path.

The production change in CreatePick.Codeunit.al only executes when ReqFEFOPick is true, but the added test does not enable FEFO or item tracking. It also does not assert that the first registered pick used the non-default shipment bin. Please add a FEFO/item-tracked regression that verifies the intended non-default shipment-bin setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

From Fork Pull request is coming from a fork Linked Issue is linked to a Azure Boards work item SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants