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

Announcements

No record found.

News and Announcements icon
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 666

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? 

 

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 728 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 545 Super User 2026 Season 2

#3
AndrewThomas81 Profile Picture

AndrewThomas81 328 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans