Skip to main content

Notifications

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

  • Suggested answer
    YUN ZHU Profile Picture
    84,557 Super User 2025 Season 1 on at
    RE: Report.Run now behaves as if it were a modal execution

    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

  • Suggested answer
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Report.Run now behaves as if it were a modal execution

    Hi,

    Try below

    commit;      

    Cust.FindFirst();

          Cust.Name += '#';

          Cust.Modify();

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

  • JJMc Profile Picture
    291 on at
    RE: Report.Run now behaves as if it were a modal execution

    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
    YUN ZHU Profile Picture
    84,557 Super User 2025 Season 1 on at
    RE: Report.Run now behaves as if it were a modal execution

    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
    RE: Report.Run now behaves as if it were a modal execution

    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

  • JJMc Profile Picture
    291 on at
    RE: Report.Run now behaves as if it were a modal execution

    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

  • Suggested answer
    Inge M. Bruvik Profile Picture
    1,029 Moderator on at
    RE: Report.Run now behaves as if it were a modal execution

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

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

  • Suggested answer
    DAnny3211 Profile Picture
    9,278 Moderator on at
    RE: Report.Run now behaves as if it were a modal execution

    hi

    look this

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

    DAniele

  • JJMc Profile Picture
    291 on at
    RE: Report.Run now behaves as if it were a modal execution

           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
    Nitin Verma Profile Picture
    21,565 Moderator on at
    RE: Report.Run now behaves as if it were a modal execution

    Please share your code in Txt format only.

    Thanks.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 1,452

#2
YUN ZHU Profile Picture

YUN ZHU 1,313 Super User 2025 Season 1

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 1,083 Most Valuable Professional

Featured topics

Product updates

Dynamics 365 release plans