Skip to content

[Main]- Error The Bin Content does not exist.Not able to post an Inventory Pick for Assemble to Order#9297

Open
DeepsShukla wants to merge 2 commits into
mainfrom
bugs/Bug-640983-Error-BinContent-does-not-exis-Not-able-to-post-InventoryPick
Open

[Main]- Error The Bin Content does not exist.Not able to post an Inventory Pick for Assemble to Order#9297
DeepsShukla wants to merge 2 commits into
mainfrom
bugs/Bug-640983-Error-BinContent-does-not-exis-Not-able-to-post-InventoryPick

Conversation

@DeepsShukla

@DeepsShukla DeepsShukla commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Workitem-Bug 640983: [ALL-E] Error: "The Bin Content does not exist...." Not able to post an Inventory Pick for Assemble to Order items

Fixes AB#642202

Issue: "The Bin Content does not exist...." Not able to post an Inventory Pick for Assemble to Order items
Cause: CheckQuantityInBinContentForTracking iterates all pick lines and calls WMSMgt.CheckWhseJnlLine (which validates existing bin content) on ATO lines — even though ATO output bin content is only created during assembly posting, not before the pick.
Solution: Skip ATO pick lines (if not WarehouseActivityLine2."Assemble to Order") in the bin-content validation loop

@DeepsShukla
DeepsShukla requested a review from a team July 10, 2026 05:25
@DeepsShukla
DeepsShukla marked this pull request as draft July 10, 2026 05:26
@github-actions github-actions Bot added this to the Version 29.0 milestone Jul 10, 2026
Comment thread src/Layers/W1/Tests/SCM-Assembly/SCMWhseAsmToOrder.Codeunit.al
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 3 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@186d8a131465475c79244d994acb872cd5c0d4bf

Findings by domain

Findings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).

Domain Findings Knowledge-backed Agent Inline Fallback
Performance 1 1 0 1 0
Testing 2 2 0 2 0

Totals: 3 knowledge-backed · 0 agent findings.

Orchestrator pre-filter (2 file(s) excluded)

  • layer-disabled (knowledge) : 2 file(s)

Findings produced by the AL review agent v1.7.3. Reply 👎 on any inline comment to flag false positives.

@DeepsShukla
DeepsShukla marked this pull request as ready for review July 13, 2026 05:20
@DeepsShukla DeepsShukla added the SCM GitHub request for SCM area label Jul 13, 2026
@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Agentic PR Review - Round 1

Recommendation: Request Changes

What this PR does

This PR changes Whse.-Activity-Post so CheckQuantityInBinContentForTracking skips warehouse activity lines marked Assemble to Order. It also adds a regression test for a sales order that mixes a normal lot-tracked item with an ATO output item on a new bin-mandatory location.

The direction is correct. Other warehouse code already treats ATO inventory pick lines differently, and the later posting path still checks the warehouse journal line after Sales-Post can create the assembly output bin content. But the procedure still exits before the loop when the first current activity line is an ATO item. That keeps the validation dependent on line order.

Suggestions

S1 - Remove the first-line ATO exit
CheckQuantityInBinContentForTracking still exits before the loop when the first activity line is an ATO item. Remove that header-level ATO exit and rely on the per-line "Assemble to Order" check. Otherwise, a mixed pick with the ATO line first skips bin-content validation for normal tracked lines; add a test for that order.

Risk assessment and necessity

Risk: This is warehouse posting logic for inventory picks, item tracking, bin content, and ATO assembly output. The change is narrow and does not change public APIs or events, but the remaining line-order dependency can bypass the intended pre-post validation for non-ATO lines before source document posting. BCApps is single-layer, so there is no country-layer ripple.

Necessity: The bug is valid and important. Without a fix, users can be blocked from posting an Inventory Pick for an ATO sales order on a new bin-mandatory location because the ATO output bin content is not available until assembly posting creates it. The scope is right, but the implementation should make the skip per-line only.


[AI-PR-REVIEW] version=1 system=github pr=9297 round=1 by=alexei-dobriansky at=2026-07-13T05:43:26Z lastSha=4f35dcaf7c80ec2afcbcf42775c2afebeaea99f1 suggestions=S1

v-ankitgoyal
v-ankitgoyal previously approved these changes Jul 13, 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.

@qasimikram qasimikram 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.

Review

S1 - Remove the first-line ATO exit

CheckQuantityInBinContentForTracking still exits before scanning the activity lines when the current first line's item is Assemble-to-Order. This leaves the new per-line skip dependent on line order: if the ATO sales line is first, the procedure returns and normal tracked lines never receive the bin-content validation.

Please remove the procedure-level ATO exit and rely on WarehouseActivityLine2."Assemble to Order" inside the loop. Add or reorder a regression test so the ATO line precedes the normal tracked line and verify that the normal line is still validated.

This is blocking because warehouse posting can bypass validation for non-ATO tracked lines based only on document line order.

Comment thread src/Layers/W1/Tests/SCM-Assembly/SCMWhseAsmToOrder.Codeunit.al
Comment thread src/Layers/W1/Tests/SCM-Assembly/SCMWhseAsmToOrder.Codeunit.al
@DeepsShukla

Copy link
Copy Markdown
Contributor Author

Review

S1 - Remove the first-line ATO exit

CheckQuantityInBinContentForTracking still exits before scanning the activity lines when the current first line's item is Assemble-to-Order. This leaves the new per-line skip dependent on line order: if the ATO sales line is first, the procedure returns and normal tracked lines never receive the bin-content validation.

Please remove the procedure-level ATO exit and rely on WarehouseActivityLine2."Assemble to Order" inside the loop. Add or reorder a regression test so the ATO line precedes the normal tracked line and verify that the normal line is still validated.

This is blocking because warehouse posting can bypass validation for non-ATO tracked lines based only on document line order.

Updated the same.

@qasimikram qasimikram 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.

Review

S1 - Evaluate Order Tracking Policy per line

CheckQuantityInBinContentForTracking still reads WarehouseActivityLine."Item No." before iterating and exits when that first item's Order Tracking Policy is None. For a mixed Inventory Pick where the first line is untracked and a later non-ATO line uses Tracking & Action Msg., the later line never receives the bin-content validation. This preserves the same line-order dependency that the ATO change is intended to remove.

Please move the policy check into the per-line loop (or otherwise evaluate each line independently), alongside the per-line ATO condition.

S2 - Make the ATO-first test detect the old behavior

InvtPickForATOLineBeforeNormalItemStillValidatesNormalLine only verifies that posting succeeds and that a warehouse entry exists. The pre-change implementation also exits early and then posts the normal line, so this test would pass before the fix and does not prove that the normal line's pre-post bin-content validation ran.

Please make the normal line fail specifically when that validation executes, or add another observable assertion that distinguishes the validation path from ordinary successful posting.

This is blocking because warehouse posting validation remains dependent on document line order, and the added test does not protect the corrected line-order behavior.

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

Labels

SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants