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

An error occurred and the transaction is stopped

(1) ShareShare
ReportReport
Posted on by 5
I Got an error message when click Preview Posting in Item Journal.
 
Error message: 
An error occurred and the transaction is stopped. Contact your administrator or partner for further assistance.
The following AL methods are limited during write transactions because one or more tables will be locked: Form.RunModal, Codeunit.Run, Report.RunModal, XmlPort.RunModal.
Form.RunModal is not allowed in write transactions.
Codeunit.Run is allowed in write transactions only if the return value is not used. For example, 'OK := Codeunit.Run()' is not allowed.
Report.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'Report.RunModal(...,false)' is allowed.
XmlPort.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'XmlPort.RunModal(...,false)' is allowed.
Use the commit method to save the changes before this call, or structure the code differently.
Contact your application developer for further assistance.
 
 
AL call stack: 
"Item Jnl.-Post"(CodeUnit 241).OnRunPreview line 7 - Base Application by Microsoft
"Gen. Jnl.-Post Preview"(CodeUnit 19).OnRunPreview(Event) line 2 - Base Application by Microsoft
"Gen. Jnl.-Post Preview"(CodeUnit 19).RunPreview line 4 - Base Application by Microsoft
"Gen. Jnl.-Post Preview"(CodeUnit 19).PreviewStart line 17 - Base Application by Microsoft
"Gen. Jnl.-Post Preview"(CodeUnit 19).Preview line 7 - Base Application by Microsoft
"Item Jnl.-Post"(CodeUnit 241).Preview line 6 - Base Application by Microsoft
"Item Journal"(Page 40)."PreviewPosting - OnAction"(Trigger) line 4 - Base Application by Microsoft
 
Has anyone encountered this issue? any Idea?
 
I checked Base Application app, it is up to date.
 
Business Central Version:
Platform Version: 24.0
Application Version:  24.5.23489.25852
Base Application Version: 24.5.23489.25852
 
Standard Code:
 
namespace Microsoft.Inventory.Posting;

using Microsoft.Finance.GeneralLedger.Journal;
using Microsoft.Finance.GeneralLedger.Preview;
using Microsoft.Inventory.Journal;

codeunit 241 "Item Jnl.-Post"
{
    EventSubscriberInstance = Manual;
    TableNo = "Item Journal Line";

    ... ...


    [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Preview", 'OnRunPreview', '', false, false)]
    local procedure OnRunPreview(var Result: Boolean; Subscriber: Variant; RecVar: Variant)
    var
        ItemJournalLine: Record "Item Journal Line";
        ItemJnlPost: Codeunit "Item Jnl.-Post";
    begin
        ItemJournalLine.Copy(RecVar);
        ItemJnlPost.SetPreviewMode(true);
        Result := ItemJnlPost.Run(ItemJournalLine);
    end;

    ... ...

}

 
I have the same question (0)
  • Gerardo Rentería García Profile Picture
    26,091 Most Valuable Professional on at
    Hi
    I have not been able to replicate it, you could try again, sometimes they apply patches for some bugs.
    Best
    gR
  • Suggested answer
    YUN ZHU Profile Picture
    99,978 Super User 2026 Season 1 on at
    Hi, I also tested it in BC24.5 and did not encounter this problem.
     
    If you think there is a problem with the standard code, you can submit it below
     
    Or aka.ms/BCYammer: Dynamics 365 Business Central Partner Community (Formerly: Development)
    More details: About Business Central partner community on Viva Engage (formerly Yammer)
     
     
    Thanks.
    ZHU
  • Brett F Profile Picture
    454 on at
    Did you figure out this error?  We have been having this error crop up at times as well.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,024 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,145 Super User 2026 Season 1

#3
Khushbu Rajvi. Profile Picture

Khushbu Rajvi. 705 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans