[Master]-[Drop shipment reversal] Undo Shipment fails with blank Bin Code at bin-mandatory location - #11274
Conversation
| ItemJnlLine."Shortcut Dimension 2 Code" := PurchRcptLine."Shortcut Dimension 2 Code"; | ||
| ItemJnlLine."Dimension Set ID" := PurchRcptLine."Dimension Set ID"; | ||
| ItemJnlLine.Description := PurchRcptLine.Description; | ||
| ItemJnlLine."Drop Shipment" := (PurchRcptLine."Sales Order No." <> '') and (PurchRcptLine."Sales Order Line No." <> 0); |
There was a problem hiding this comment.
The new "Drop Shipment" derivation in UndoPurchaseReceiptLine.Codeunit.al uses (PurchRcptLine."Sales Order No." <> '') and (PurchRcptLine."Sales Order Line No." <> 0), but the existing, equivalent derivation elsewhere in the base app (PurchRcptLine.Table.al, InsertInvLineFromRcptLine: if "Sales Order No." = '' then PurchLine."Drop Shipment" := false else PurchLine."Drop Shipment" := true) keys off "Sales Order No." alone. If a drop-shipment receipt line can legitimately have a populated "Sales Order No." with a zero "Sales Order Line No." (e.g. due to partial data migration, an upstream defect, or a not-yet-linked line), the new undo logic would compute "Drop Shipment" = false while the rest of the app would treat the same line as a drop shipment, causing the reversing item journal line to under- or over-report Drop Shipment status inconsistently with sibling logic.
Recommendation:
- align the condition with the established
"Sales Order No." <> ''check used elsewhere, or, if the extra"Sales Order Line No." <> 0guard is intentionally stricter, add a brief comment explaining why undo processing diverges from the existing convention.
👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6
Fixes AB#649618