Skip to content

[Main] -Drop shipment undo receipt fails for service and non-inventory items. - #10154

Open
DhavalMore88 wants to merge 4 commits into
microsoft:mainfrom
DhavalMore88:bugs/Bug-646535-Main-Drop-shipment-undo-receipt-fails
Open

[Main] -Drop shipment undo receipt fails for service and non-inventory items.#10154
DhavalMore88 wants to merge 4 commits into
microsoft:mainfrom
DhavalMore88:bugs/Bug-646535-Main-Drop-shipment-undo-receipt-fails

Conversation

@DhavalMore88

@DhavalMore88 DhavalMore88 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Bug 646535: [master] [ALL-E] Drop shipment undo receipt fails for service and non-inventory items.

AB#646535

Issue: When a Drop Shipment is posted for a Service or Non-Inventory item, both Undo Shipment on the Posted Sales Shipment and Undo Receipt on the Posted Purchase Receipt fail with There is no Item Application Entry within the filter. Filters: Item Ledger Entry No.: 888, Inbound Item Entry No.: 887, Outbound Item Entry No.: 888, Cost Application: Yes. Because Undo Receipt internally calls Undo Shipment for the linked drop shipment line, one defect blocks both actions and the linked document can never be reversed.

Cause: Two problems. (1) In UnApplyDropShipment in UndoSalesShipmentLine.Codeunit.al (CU 5815), the lookup filtered on ItemApplicationEntry.SetRange("Cost Application", true) and then called FindFirst() unguarded. Non-inventoriable items post a drop shipment application entry that carries no cost, so the "Cost Application" field is not set and the record is filtered out — even though the callee ItemJnlPostLine.UnApplyDropShipment never reads that field. (2) In FindSalesShipmentLine in UndoPurchaseReceiptLine.Codeunit.al (CU 5813), the linked Sales Shipment Line was resolved only through Item Ledger / Item Application Entries and ended with an unguarded FindFirst(), which errors for these items because that application link is not always present.

Solution: Removed the "Cost Application" filter in UnApplyDropShipment and guarded the lookup with if ItemApplicationEntry.FindFirst() then, so cost-less drop shipment application entries are unapplied and a missing entry is simply skipped instead of erroring. In FindSalesShipmentLine, the Item Ledger Entry path now exits only on a successful FindFirst(), otherwise it falls back to the new FindSalesShipmentLineByDropShipmentLink, which locates the Sales Shipment Line through the drop shipment document link (Order No./Order Line No./Purchase Order No./Purch. Order Line No. with Drop Shipment = true, Correction = false). The change was propagated to the RU layer copy of CU 5815 via Miapp; CU 5813 has no country overrides.

@github-actions github-actions Bot added From Fork Pull request is coming from a fork SCM GitHub request for SCM area Linked Issue is linked to a Azure Boards work item labels Aug 11, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Aug 11, 2026
@DhavalMore88
DhavalMore88 marked this pull request as ready for review August 13, 2026 13:12
@DhavalMore88
DhavalMore88 requested a review from a team August 13, 2026 13:12
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.

1 participant