Skip to main content

Notifications

Community site session details

Community site session details

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

Sales Order/Invoice Preview Posting Error

(0) ShareShare
ReportReport
Posted on by 1,144

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
    RonakPatil1998 Profile Picture
    on at
    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
    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
    1,636 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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,261 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,994 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans