Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

Sales Order/Invoice Preview Posting Error

(0) ShareShare
ReportReport
Posted on by 1,120

Testing the upgrade to V18.1 from 17.5.  No errors of any kind as part of the upgrade itself.  However, in the upgraded environment we attempt to preview post a sales order or sales invoice we are getting the following message.  Straight posting does NOT get this error.  This error did not occur in 17.5.  We have performed multiple Sandbox upgrades and get this same error.

Commit is prohibited in the current scope. The operation cannot continue. Contact your system administrator.

  • Suggested answer
    Sales Order/Invoice Preview Posting Error
    If your using EventSubscriber then you need to check preview posting flag to execute code.

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnAfterPostSalesDoc', '', false, false)]
    local procedure OnAfterPostSalesDoc(var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; SalesShptHdrNo: Code[20]; RetRcpHdrNo: Code[20]; SalesInvHdrNo: Code[20]; SalesCrMemoHdrNo: Code[20]; CommitIsSuppressed: Boolean; InvtPickPutaway: Boolean; var CustLedgerEntry: Record "Cust. Ledger Entry"; WhseShip: Boolean; WhseReceiv: Boolean; PreviewMode: Boolean)
        var
            SalesLine: Record "Sales Line";
            IsFullyShipped: Boolean;
        begin
            // Check if the document type is Order
            if SalesHeader."Document Type" <> SalesHeader."Document Type"::Order then
                exit;
            if PreviewMode = false then begin
                // Code to execute without preview mode
            end;
        end;
  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Sales Order/Invoice Preview Posting Error

    Hello,

    The error sounds like you have an extension effecting the Preview Posting functionality. I would contact your Partner to assist.

    Thanks,

    Steve

  • Suggested answer
    tanya07 Profile Picture
    tanya07 1,548 on at
    RE: Sales Order/Invoice Preview Posting Error

    Hi,

    Do you have any customization in this process of posting ?

    Thanks,

    Tanya

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

Congratulations 2024 Spotlight Honorees!

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December!

Congratulations to our December super stars! 🥳

Get Started Blogging in the Community

Hosted or syndicated blogging is available! ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,642 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,371 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans