Skip to main content

Notifications

Business Central forum
Unanswered

An error occurred and the transaction is stopped

Posted on by
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;

    ... ...

}

 
Categories:

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

News and Announcements

Forum Structure Changes Coming Soon!

Quick Links

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,734 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,021 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans