Open form without link to "parent" form?

pdj
Member Posts: 643
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
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
Peter
0
Comments
-
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" />0 -
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
Peter0 -
currform.visible(false);
FORM.RUNMODAL(FORM::"Your strange window");
currform.close;
try this.
hreinn@tolvumyndir.is0 -
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
Peter0 -
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.
hreinn0 -
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.ee0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions