Question about var.runmodal & form.runmodal

kuloicatkuloicat Member Posts: 9
I find a question about run and runmodal
I know what's different between run and runmodal
but I don't know what is the different between followings

1.Create variable type form and code : VAR.RUNMODAL

2.FORM.RUNMODAL(formID)

any idea? thanks

Comments

  • kinekine Member Posts: 12,562
    in case of Var.RUNMODAL, you can call functions of the form, you have still the state of the form in memory (the form global variables are existing, have the value etc.)... if you call only FORM.RUNMODAl you have only return value and no access to the functions of the form etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • kuloicatkuloicat Member Posts: 9
    thanks kine :wink:
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    PS, Same goes for report, dataport and codeunit. 8)
  • EmjuEmju Member Posts: 11
    Codeunits can only be run with CODEUNIT.RUN(id,[rec]) or variableCU.RUN([rec]).
    --
    Tom
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Oops. :oops: O:)

    You are right off course :mrgreen:
  • dblaisdelldblaisdell Member Posts: 7
    I do not understand the differences between RUN & RUNMODAL. I know there are question on the exam and I am taking it in 2 days. Can someone please explain this to me and under what circumstances each would be used.
  • krikikriki Member, Moderator Posts: 9,112
    dblaisdell wrote:
    I do not understand the differences between RUN & RUNMODAL. I know there are question on the exam and I am taking it in 2 days. Can someone please explain this to me and under what circumstances each would be used.
    If you use RUN, you can work in the object from where you run it.
    if you use RUNMODAL, you CANNOT work in the object from where you run it. First you have to close the object you just run.

    So if you want that the user FIRST closes the object you just run, before continuing on the original object, you must use RUNMODAL. (e.g. use it for lookupforms)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • dblaisdelldblaisdell Member Posts: 7
    If you want to run a form and the user information will be used for futher processing back in the calling object, what code is correct?
    a) variableform.RUNMODAL.
    b) variableform.RUN.
    c) FORM.RUN(FORM::Form_Name,rec).
    d) FORM.RUNMODAL(FORM::Form_Name,rec). Is d correct
  • krikikriki Member, Moderator Posts: 9,112
    dblaisdell wrote:
    If you want to run a form and the user information will be used for futher processing back in the calling object, what code is correct?
    a) variableform.RUNMODAL.
    b) variableform.RUN.
    c) FORM.RUN(FORM::Form_Name,rec).
    d) FORM.RUNMODAL(FORM::Form_Name,rec). Is d correct

    This question means the form is used as a lookupform to select a value from another table to be used in current table.

    The MS/Navision answer is d) because in "rec" is the record the user selected.

    In reality also a) would be correct because you can get back the value you need. And sometimes you will need a) because d) is not good enough. (e.g. you want to send some information into the form you want to call)
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.