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

Report.Run now behaves as if it were a modal execution

(0) ShareShare
ReportReport
Posted on by 291

Good morning all.

In the lates versions, I has to change my code, and when I had a report.run, now I had to add before a commit, because Report.run now behaves as report.runmodal.

Is the any other way to solve this? becuase I flee from commits as the plage ;-)

Thank you ever so much

I have the same question (0)
  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Please share your code in Txt format only.

    Thanks.

  • JJMc Profile Picture
    291 on at

           Cust.FindFirst();

           Cust.Name += '#';

           Cust.Modify();

           Report.Run(Report::"Customer - Top 10 List");

    Then I get this error:

    Los siguientes métodos de AL solo se pueden usar de forma limitada en transacciones de escritura porque se bloquearán una o más tablas:

    No se permite Form.RunModal en transacciones de escritura.

    Codeunit.Run solo se permite en transacciones de escritura si no se usa el valor de retorno. Por ejemplo, 'OK := Codeunit.Run()' no está permitido.

    Report.RunModal solo se permite en transacciones de escritura si 'RequestForm = false'. Por ejemplo, 'Report.RunModal(...,false)' sí está permitido.

    XmlPort.RunModal solo se permite en transacciones de escritura si 'RequestForm = false'. Por ejemplo, 'XmlPort.RunModal(...,false)' sí está permitido.

    Use el método commit para guardar los cambios antes de esta llamada o cambie la estructura del código..

    Póngase en contacto con el desarrollador de la aplicación para obtener más ayuda.

  • Suggested answer
    DAnny3211 Profile Picture
    11,421 Super User 2026 Season 1 on at

    hi

    look this

    learn.microsoft.com/.../reportinstance-run-method

    DAniele

  • Suggested answer
    IB-29041624-0 Profile Picture
    1,177 Moderator on at

    Why do you need to modify the customername before you run the report?

    If you skip that the report should run fine I think.

  • JJMc Profile Picture
    291 on at

    Thank you Daniele for your answer, but I do not see your point.

    I understand what a object.runmodal is and work, but I do not understand why now a report.run behaves as report.runmodal

  • JJMc Profile Picture
    291 on at

    That was not real code. It was just an example to prove or show that now report.run after a modify, delete or insert operation, behaves the same as report.runmodal.

    Thank you anyway for taking your time reading and answering this question

  • Suggested answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at

    Hi, I tested the code below and it works without issue. So I think the problem should have nothing to do with Report.Run method.

    pastedimage1676251291817v2.png

    pastedimage1676251269093v1.png

    Hope this can give you some hints.

    Thanks.

    ZHU

  • JJMc Profile Picture
    291 on at

    Thank you ZHU for your reply, but I can see you do not modify, insert o delete any record in any table. That' is why you do not have any issue.

  • Suggested answer
    Nitin Verma Profile Picture
    21,812 Moderator on at

    Hi,

    Try below

    commit;      

    Cust.FindFirst();

          Cust.Name += '#';

          Cust.Modify();

          Report.Run(Report::"Customer - Top 10 List");

  • Suggested answer
    YUN ZHU Profile Picture
    100,212 Super User 2026 Season 1 on at

    Hi, I understand what you mean. In this case, if you need to use Report.Run, you need to add a Commit.

    For example,

    pastedimage1676273476280v1.png

    Hope this helps.

    Thankks.

    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

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 April 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,012 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 986 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 659 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans