Skip to main content

Notifications

Business Central forum
Suggested answer

An error occurred and the transaction is stopped

Posted on by 224
Hi,
 
Since the update to BC22, our client is getting this error when trying to post a Sales Order for a customer that is linked to an IC Partner
An error occurred and the transaction is stopped
 
IC Partner is configured with Transfer Type = Email
The email address entered is valid.
 
The xml file gets generated
Setup hasn't changed
There is no custom code
 
Any idea?
 
Call Stack is: 
 

"Email Impl"(CodeUnit 8900).Send line 4 - System Application by Microsoft
Email(CodeUnit 8901).Send line 2 - System Application by Microsoft
"Mail Management"(CodeUnit 9520).SendViaEmailModule line 48 - Base Application by Microsoft
"Mail Management"(CodeUnit 9520).DoSend line 5 - Base Application by Microsoft
"Mail Management"(CodeUnit 9520).Send line 16 - Base Application by Microsoft
"Mail Management"(CodeUnit 9520).SendMailOrDownload line 7 - Base Application by Microsoft
"Email Item"(Table 9500).Send line 5 - Base Application by Microsoft
"Document-Mailing"(CodeUnit 260).EmailFileInternal line 59 - Base Application by Microsoft
"Document-Mailing"(CodeUnit 260).EmailFile line 7 - Base Application by Microsoft
"IC Outbox Export"(CodeUnit 431).SendToExternalPartner line 92 - Base Application by Microsoft
"IC Outbox Export"(CodeUnit 431).RunOutboxTransactions line 21 - Base Application by Microsoft
"IC Outbox Export"(CodeUnit 431).ModifyAndRunOutboxTransactionNo line 8 - Base Application by Microsoft
"IC Outbox Export"(CodeUnit 431).ProcessAutoSendOutboxTransactionNo line 12 - Base Application by Microsoft
"IC Inbox Outbox Subscribers"(CodeUnit 790).AutoSendOnInsertICOutboxSalesDocTransaction line 2 - Base Application by Microsoft
ICInboxOutboxMgt(CodeUnit 427).OnInsertICOutboxSalesDocTransaction(Event) line 2 - Base Application by Microsoft
ICInboxOutboxMgt(CodeUnit 427).CreateOutboxSalesDocTrans line 111 - Base Application by Microsoft
ICInboxOutboxMgt(CodeUnit 427).SendSalesDoc line 36 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).SendICDocument line 16 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).ProcessPostingLines line 91 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).ProcessPostingLinesCommitBehaviorIgnore line 6 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).ProcessPosting line 12 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).RunWithCheck line 59 - Base Application by Microsoft
"Sales-Post"(CodeUnit 80).OnRun(Trigger) line 2 - Base Application by Microsoft
"Sales-Post (Yes/No)"(CodeUnit 81).RunSalesPost line 12 - Base Application by Microsoft
"Sales-Post (Yes/No)"(CodeUnit 81).Code line 25 - Base Application by Microsoft
"Sales-Post (Yes/No)"(CodeUnit 81).OnRun(Trigger) line 10 - Base Application by Microsoft
"Sales Header"(Table 36).SendToPosting line 12 - Base Application by Microsoft
"Sales Order"(Page 42).PostSalesOrder line 10 - Base Application by Microsoft
"Sales Order"(Page 42)."Post - OnAction"(Trigger) line 2 - Base Application by Microsoft
/>/Email Impl/(CodeUnit 8900).Send line 41 - System Application by Microsoft
/Email Impl/(CodeUnit 8900).Send line 4 - System Application by Microsoft
Email(CodeUnit 8901).Send line 2 - System Application by Microsoft
/Mail Management/(CodeUnit 9520).SendViaEmailModule line 48 - Base Application by Microsoft
/Mail Management/(CodeUnit 9520).DoSend line 5 - Base Application by Microsoft
/Mail Management/(CodeUnit 9520).Send line 16 - Base Application by Microsoft
/Mail Management/(CodeUnit 9520).SendMailOrDownload line 7 - Base Application by Microsoft
/Email Item/(Table 9500).Send line 5 - Base Application by Microsoft
/Document-Mailing/(CodeUnit 260).EmailFileInternal line 59 - Base Application by Microsoft
/Document-Mailing/(CodeUnit 260).EmailFile line 7 - Base Application by Microsoft
/IC Outbox Export/(CodeUnit 431).SendToExternalPartner line 92 - Base Application by Microsoft
/IC Outbox Export/(CodeUnit 431).RunOutboxTransactions line 21 - Base Application by Microsoft
/IC Outbox Export/(CodeUnit 431).ModifyAndRunOutboxTransactionNo line 8 - Base Application by Microsoft
/IC Outbox Export/(CodeUnit 431).ProcessAutoSendOutboxTransactionNo line 12 - Base Application by Microsoft
/IC Inbox Outbox Subscribers/(CodeUnit 790).AutoSendOnInsertICOutboxSalesDocTransaction line 2 - Base Application by Microsoft
ICInboxOutboxMgt(CodeUnit 427).OnInsertICOutboxSalesDocTransaction(Event) line 2 - Base Application by Microsoft
ICInboxOutboxMgt(CodeUnit 427).CreateOutboxSalesDocTrans line 111 - Base Application by Microsoft
ICInboxOutboxMgt(CodeUnit 427).SendSalesDoc line 36 - Base Application by Microsoft
/Sales-Post/(CodeUnit 80).SendICDocument line 16 - Base Application by Microsoft
/Sales-Post/(CodeUnit 80).ProcessPostingLines line 91 - Base Application by Microsoft
/Sales-Post/(CodeUnit 80).ProcessPostingLinesCommitBehaviorIgnore line 6 - Base Application by Microsoft
/Sales-Post/(CodeUnit 80).ProcessPosting line 12 - Base Application by Microsoft
/Sales-Post/(CodeUnit 80).RunWithCheck line 59 - Base Application by Microsoft
/Sales-Post/(CodeUnit 80).OnRun(Trigger) line 2 - Base Application by Microsoft
/Sales-Post (Yes/No)/(CodeUnit 81).RunSalesPost line 12 - Base Application by Microsoft
/Sales-Post (Yes/No)/(CodeUnit 81).Code line 25 - Base Application by Microsoft
/Sales-Post (Yes/No)/(CodeUnit 81).OnRun(Trigger) line 10 - Base Application by Microsoft
/Sales Header/(Table 36).SendToPosting line 12 - Base Application by Microsoft
/Sales Order/(Page 42).PostSalesOrder line 10 - Base Application by Microsoft
/Sales Order/(Page 42)./Post - OnAction/(Trigger) line 2 - Base Application by Microsoft

 
 
 
 
Categories:
  • Suggested answer
    niklasl Profile Picture
    niklasl 4 on at
    An error occurred and the transaction is stopped
    The error was due to open transaction when a Codeunit.Run was called, even if there was a Commit before the Run call..
    The reason for the error is the call to
    "Sales-Post"(CodeUnit 80).ProcessPostingLinesCommitBehaviorIgnore line 6 - Base Application by Microsoft
    This function is set to ignore Commits...
     
    Workaround to call ProcessPostingLines instead of ProcessPostingLinesCommitBehaviorIgnore in CU 80:
    codeunit 78650 "Sales-Post Commit Behaviour"
    {
        SingleInstance = true;
     
        var
            SetErrorOnCommit: Boolean;
     
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnRunOnBeforeCheckAndUpdate', '', false, false)]
        local procedure OnRunOnBeforeCheckAndUpdate(var SalesHeader: Record "Sales Header")
        begin
            if SalesHeader."Send IC Document" and (SalesHeader."IC Status" = SalesHeader."IC Status"::New) and (SalesHeader."IC Direction" = SalesHeader."IC Direction"::Outgoing)
                and (SalesHeader."Document Type" in [SalesHeader."Document Type"::Order, SalesHeader."Document Type"::"Return Order"]) then
                SetErrorOnCommit := true
            else
                SetErrorOnCommit := false;
        end;
     
        [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnSetCommitBehavior', '', false, false)]
        local procedure OnSetCommitBehavior(var ErrorOnCommit: Boolean)
        begin
            if SetErrorOnCommit then
                ErrorOnCommit := false;
        end;
    }
  • niklasl Profile Picture
    niklasl 4 on at
    An error occurred and the transaction is stopped
    Did you find out what the problem was?
    I have the same issue and cannot find what is causing this.
  • Juliem Profile Picture
    Juliem 224 on at
    An error occurred and the transaction is stopped
    I am the developer debugging it but can't find much
    All I can see is that it's stopping in the Email Impl.dal but I can't see the code
     
    We are able to send other emails without issues (order confirmation, approval process, etc...)
     
  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 71,471 Super User 2024 Season 2 on at
    An error occurred and the transaction is stopped
    Sorry I'm not sure about the exact problem, it's best to have a developer debug it so you can spot the problem quickly.
    However, the IC Partner setting in BC22 has been updated, and it may be a setting problem, you can check again.
     
    Hopefully other experts can give you better advice.
     
    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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,888 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,247 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans