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

Getting error during posting sales order..... please enter ship and invoice "Yes".

(5) ShareShare
ReportReport
Posted on by 355
Getting error during posting  sales order..... please enter ship and invoice "Yes". 
i have a event subscriber in my custom code for both sales order and sales invoice as i want it block posting if my solution throw error. On sales invoice it work but on sales order it throws an error
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostSalesDoc', '', false, false)]
 
I have the same question (0)
  • Suggested answer
    OussamaSabbouh Profile Picture
    12,878 Super User 2026 Season 1 on at
    Hello,
     
    Your event subscriber is clearing the posting flags. In OnBeforePostSalesDoc, if you touch (or indirectly reset) Ship / Invoice / Receive or set IsHandled := true, BC ends up with all flags = false, causing the error. It works on Sales Invoices because Invoice is forced true there.
    Fix: only validate and raise Error() in the subscriber. Don’t modify posting flags and don’t set IsHandled. Optionally guard for Orders only.
     
    Regards,
    Oussama Sabbouh
  • Suggested answer
    YUN ZHU Profile Picture
    99,084 Super User 2026 Season 1 on at
    Hi, You can try the events I mentioned below.
    Dynamics 365 Business Central: Check posting date before posting (preview posting) in the sales and purchase documents – Customization
     
    Thanks.
    ZHU
  • Suggested answer
    Khushbu Rajvi. Profile Picture
    22,128 Super User 2026 Season 1 on at
    This typically happens if your customization is calling Codeunit 80 directly instead of using Sales-Post (Yes/No) / the standard Post action that sets Ship/Invoice.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,946 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,177 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 555 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans