web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Warehouse Shipment Vanished/ deleted on Posting of Warehouse Shipment Lines

(0) ShareShare
ReportReport
Posted on by 629

Good day, 

I need the procedure in Warehouse Shipments where the Warehouse Header is deleted/removed as soon as the last line in the Warehouse Shipment Lines has been posted. 
I used the event recorder and searched in the base code but with no luck. 

Here are my findings thus far. 

In Codeunit 5763 "Whse.-Post Shipment" all the posting is handled in the procedure "Code"
One of the last procedures "OnAfterPostWhseShipment" still refers to the Warehouse Shipment Header. Which indicates even after posting the Warehouse Shipment the header still exists. 
pastedimage1657014969260v2.png

After the code Procedure in Codeunit 5763 "Whse.-Post Shipment" we return to codeunit 5764 "Whse.-Post Shipment (Yes/No)". At the end of the "Code" prcodeure in Codeunit 5763 we have a procedure  OnAfterCode(WhseShptLine) that is the last reference of the whseShptLine.

We are then returned back to the Warehouse Shipment Card which is the end of the action.

I never saw code that actually deletes the Header from the Table, but I did see in the eventrecorder that the OnPageClose for warehouseShipment Card was called as well as the OnQueryPageClose. 

Question:  How can I prevent the WarehouseShipment Card from closing adn the WarehouseShipment Header from being delteted of the table even after all the lines have been posted? 

 

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,698 Moderator on at
    RE: Warehouse Shipment Vanished/ deleted on Posting of Warehouse Shipment Lines

    Hi,

    I am not sure you want to prevent header not to be deleted, but you can use the below event from the

    codeunit 5763 "Whse.-Post Shipment"

    OnPostUpdateWhseDocumentsOnBeforeUpdateWhseShptHeader

    pastedimage1657017949444v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,377

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 2,696 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,512 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans