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

Automated Testing in Business central (BC16)

(0) ShareShare
ReportReport
Posted on by 115

Hi Community, I am doing automated testing in Business central and while testing one of my functions is using following code:

CreatesubscriptionInvoices.RunModal();

CreatesubscriptionInvoices variable is of type Report.
to run processing only report along with a request page but as soon code hits that line test case becomes failed and following error appears;


"The following C/AL functions are limited during write transactions because one or more tables will be locked. Form.RunModal is not allowed in write transactions. Codeunit.Run is allowed in write transactions only if the return value is not used."


Anyone knows what its means and how to solve it ?
thanks

  • Suggested answer
    THE Italian Profile Picture
    Microsoft Employee on at

    I would avoid the RUNMODAL. If you search for KB article in business central and NAV, you will find out a lot of these error that has all been resolved with application code changes.

    In short: refactor your code to avoid running modally or circumvent this error.

    It is not a platform issue.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 664 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 446 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 282 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans