RUN and RUNMODAL

roshanthaparoshanthapa Member Posts: 90
After reading help file and the questions at mibuso, I am bit confused with these terms now.

I see both of these terms (run and runmodal) working similarly but I think there must be some differnce between these two. Can anybody please clarify me what are the differences between these two and in what particular situation are these two terms used i.e. RUN and RUNMODAL?

Please enlighten me.........

Roshan Thapa

Comments

  • ufukufuk Member Posts: 514
    Runmodal could be used with the actions (Lookup,Yes,No etc.) You run the form modally and evaluate the case due to the form's action.
    Ufuk Asci
    Pargesoft
  • PeterDPeterD Member Posts: 66
    True, but to put it differently:

    RUN opens your form, report or dataport and just continues to execute your code.

    RUNMODAL opens your form, report or dataport and waits for user interaction before it continues to execute your code. This way you can use the results like ufuk explained. But it also
  • David_SingletonDavid_Singleton Member Posts: 5,479
    At first glance they look similar, but in reality they are very different. To understand why, you need to understand the Version principle in Navision.

    bascially if you are running a transaction and then you launch a form with RUNMODAL, then the form is launched as a part of the current transaction. Which means that your current version is committed only when the form is closed, control returned to the transaction, and it completes through to a commit.

    This is why its possible to use the results of the form, since the instance of the form is a part of the transaction. This also means that so long as the form is open, your transaction is also open, this is why you are not allowed to RUNMODAL with uncommitted transactions, since it would lock the database until the user presses OK or closes the from.

    When you call RUN, the current transaction simply launches a new form as a completely new and unrelated transaction, and then continues on with processing. Obviously since the transaction could be complete before the user even sees the form, there is no way to pass data from this form back to the current transaction.
    David Singleton
  • gulamdastagirgulamdastagir Member Posts: 411
    fantastic explanation =D>
    Regards,

    GD
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Thanks
    David Singleton
  • roshanthaparoshanthapa Member Posts: 90
    Thanx people for such set of nice explanations.

    Thanx DAVID.......... You are the boss here. Navision forums like Mibuso and dynamicsusers.net should feel proud to have you.


    Thanx for such a nice explanation...... to all

    Roshan
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Thanx people for such set of nice explanations.

    Thanx DAVID.......... You are the boss here. Navision forums like Mibuso and dynamicsusers.net should feel proud to have you.


    Thanx for such a nice explanation...... to all

    Roshan

    Aw shucks ... :oops: :oops: :oops: THANKS!
    David Singleton
  • garakgarak Member Posts: 3,263
    Does nobody navision programmer beginner read the Application Designer or other documentations????
    Do you make it right, it works too!
  • jlandeenjlandeen Member Posts: 524
    One addition to David's solid explanation is how RUN and RUNMODAL work in a form example.

    If you have FormA that calls FormB using RUN then a user will be able to click or activate both Forms as they are running simultaneously.

    However if you have FormA call FormB using RUNMODAL the user can only work with FormB. The user cannot click on back to FormA or use FormA in any way until they have closed FormB and Navision has returned control to the calling form.
    Jeff Landeen - Sr. Consultant
    Epimatic Corp.

    http://www.epimatic.com
  • idiotidiot Member Posts: 651
    At first glance they look similar, but in reality they are very different. To understand why, you need to understand the Version principle in Navision.

    bascially if you are running a transaction and then you launch a form with RUNMODAL, then the form is launched as a part of the current transaction. Which means that your current version is committed only when the form is closed, control returned to the transaction, and it completes through to a commit.

    This is why its possible to use the results of the form, since the instance of the form is a part of the transaction. This also means that so long as the form is open, your transaction is also open, this is why you are not allowed to RUNMODAL with uncommitted transactions, since it would lock the database until the user presses OK or closes the from.

    When you call RUN, the current transaction simply launches a new form as a completely new and unrelated transaction, and then continues on with processing. Obviously since the transaction could be complete before the user even sees the form, there is no way to pass data from this form back to the current transaction.
    Please submit this to M$
    I want F1 to give me this info
    NAV - Norton Anti Virus

    ERP Consultant (not just Navision) & Navision challenger
  • gulamdastagirgulamdastagir Member Posts: 411
    you just stole the words out of my mouth =D>
    Regards,

    GD
  • David_SingletonDavid_Singleton Member Posts: 5,479
    you just stole the words out of my mouth =D>

    Thanks again :mrgreen:
    David Singleton
  • roshanthaparoshanthapa Member Posts: 90
    garak wrote:
    Does nobody navision programmer beginner read the Application Designer or other documentations????

    Well Garak, It's not that we didn't read the application programmers' Guide or the other documentations. We did read those documentations but the universal fact is that you can't remember all the information when you are new to such field or sometimes some parts are left unnoticeably untouched.


    Personally, I feel that even if you are a knowledgeable person, you should not try to dominate but should show us the correct path like others do. And asking such confusing things is much better than reveiwing the documentations because the people here come up with better explanations and examples. Thta's why I asked to enlighten me...............
  • David_SingletonDavid_Singleton Member Posts: 5,479
    After reading help file and the questions at mibuso, I am bit confused with these terms now. ...
    garak wrote:
    Does nobody navision programmer beginner read the Application Designer or other documentations????

    I think Roshan has read the documentation and searched the forums, he is now just trying to start a discussion to get a better understanding. Of course everyone should read the manuals, but sometimes sharing someone elses experience is better than just reading.
    David Singleton
Sign In or Register to comment.