Open form without link to "parent" form?

pdjpdj Member Posts: 643
edited 2000-01-12 in Navision Financials
While being on the Vendor card I would like to open a new window. The new window should "replace" the existing Vendor card, and therefore close the existing window.

A button with:
FORM.RUN(FORM::"My new funny Window");
CurrForm.CLOSE;
also closes the new window. Anyway to avoid that?

TIA
Peter
Regards
Peter

Comments

  • hreinnhreinn Member Posts: 8
    How about creating a new form, which has the vendor card as a subform, and another subform which would be "My new strange Window" and placing them on top of each other.

    Have the code behind your button like this.
    CurrForm.Visible(FALSE);

    There probably is a much better way though <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />
  • pdjpdj Member Posts: 643
    Actually a very good idea! But not in this case :-(

    The differences between the Vendor card, and my new funny window, is that my window shows a LOT of information, and therefore only used in some situations. When done as you say, it still makes all the DB calls, eventhough the window is not shown... Thanks anyway :-)
    Regards
    Peter
  • hreinnhreinn Member Posts: 8
    currform.visible(false);
    FORM.RUNMODAL(FORM::"Your strange window");
    currform.close;

    try this.

    hreinn@tolvumyndir.is
  • pdjpdj Member Posts: 643
    At first sight it actually works.

    (Btw, I want the botton on both windows, so I can switch between them)

    But since the first window isn't really closed until the showing window is closed, it gives my a GPF if you switch to many times... Apparently NF can't handle an unlimeted number of references in its stack..
    Regards
    Peter
  • hreinnhreinn Member Posts: 8
    Well, i took another look at it, and here is one way.
    It works, but it´s not the best design, you have to place your button in a very strange place.

    Create a form, let it contain 2 subforms,
    the vendor and your strange window.


    the 1000 is to make up for the button, but you have to
    place it under the two forms, probably some other way around that. 1000 is not the correct number, you figure that one out for yourself <img border="0" title="" alt="" src="images/smiles/icon_smile.gif" />

    the code for the button is:

    currform.vendor.visible(not currform.vendor.visible);
    currform.strange.visible(not currform.strange.visible);
    if currform.strange.visible then begin
    CurrForm.WIDTH(CurrForm.strange.WIDTH);
    CurrForm.Height(CurrForm.strange.Height + 1000);
    end else begin
    CurrForm.WIDTH(CurrForm.vendor.WIDTH);
    CurrForm.Height(CurrForm.vendor.Height + 1000);
    end;


    hope it helps.
    hreinn
  • UrmasUrmas Member Posts: 76
    There is also a way not to use a subform at all.

    The additional one should be run in place of the vendor card. The onOpen trigger should contain a code to hide the current form and run the vendor card modally. To display the other form, you should close the vendor card and supply a function that could tell the primary form that displaying of another form is requested.
    Be extremely careful not to leave the primary form opened when you simply close the vendor card or other form, as the opened hidden form is an effective way to disable all Navison menus, therefor forcing user to restart their computer in order to quit NF.

    Urmas Pill
    urmas.pill@rlk.ee
Sign In or Register to comment.