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

Notifications

Announcements

No record found.

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".

(4) ShareShare
ReportReport
Posted on by 269
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
    6,268 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
    95,714 Super User 2025 Season 2 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

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 2,664

#2
YUN ZHU Profile Picture

YUN ZHU 960 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans