Form.RunModal

aka_USAPAaka_USAPA Member Posts: 62
I'm trying to pass a variable to an object. I'm using a form to input data. I have a form variable and the actual command is:

if FORM.RUNMODAL = ACTION::OK THEN BEGIN
...
END;

I know there is a command you have to issue so that Navision will automatically put an OK button on the form. Does anybody know the command and syntax? Please let me know. Thanks.

Comments

  • vijay_gvijay_g Member Posts: 884
    hi,
    there r two way to lookup a form
    first is define table relation property of field another is write code onlookup trigger on that field like:-


    IF FORM.RUNMODAL(FORM::FORMNAME,FIRELDNAME)=ACTION::LookupOK THEN
    FIELD := FORM.FIELD;
    is second case form will automatically show ok,cancal button.

    for more detail see
    viewtopic.php?f=23&t=38328&hilit=runmodal
  • lvanvugtlvanvugt Member Posts: 774
    Indeed and of course you need to be sure that the form does have OK/Cancel buttons.

    In case it is a list form (Tabular-Type) it will get it by default when using the Form wizard.

    In case it's a card form the wizard will not assign the OK/Cancel buttons. You will have to put them on the form yourself. The best and simplest way to do this is to copy them from another form and paste them on your (card) form. This way all properties of the the buttons are set right.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
  • krikikriki Member, Moderator Posts: 9,110
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • aka_USAPAaka_USAPA Member Posts: 62
    lvanvugt wrote:
    Indeed and of course you need to be sure that the form does have OK/Cancel buttons.

    In case it is a list form (Tabular-Type) it will get it by default when using the Form wizard.

    In case it's a card form the wizard will not assign the OK/Cancel buttons. You will have to put them on the form yourself. The best and simplest way to do this is to copy them from another form and paste them on your (card) form. This way all properties of the the buttons are set right.

    Can somebody provide me an example or a Form ID?

    BTW - I know it's a command you can issue but it's been a while since I've done it and I've forgotten it.
  • lvanvugtlvanvugt Member Posts: 774
    An example of (1) a list form is the Customer List (2) card form is the Customer Card. Open them in design m ode (from f.e. Object Designer). You will see that the first does have OK/Cancel buttons while the second has none of these.
    If your form (activated by your From.RunModal) does not have OK/Cancel buttons - and seems to me that's the case) you need to put them on your for like I explained before.

    Hope this makes sense.
    Luc van Vugt, fluxxus.nl
    Never stop learning
    Van Vugt's dynamiXs
    Dutch Dynamics Community
Sign In or Register to comment.