Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 19, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Open a modeless form
Tom Kaiser
Posts: 11
 
Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 07 10:11 PM
I have a client who is asking to have a modeless form display some historical information. This form would remain open, while allowing normal access to the rest of the salesLogix application. I think I have tried each of the options with the various methods of opening a form, whether with DoInvoke or using main views. In each case, the form is modal.

Is this something that needs to be developed in using an external application?

Thanks,

Tom Kaiser
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 07 10:17 PM
You can do it as long as you launch the form as a MainView.

Something like this (not tested code)

Dim mv

Set mv = Application.MainViews.Add("System:MyForm", 2, False)
mv.Show


The key to the code is the "2", which is for mvsStayOnTop and the call to "Show" instead of "ShowModal".
[Reply][Quote]
Tom Kaiser
Posts: 11
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 07 10:40 PM
Ryan,

Thanks for the quick response. I was able to open the form, and indeed it is modeless. However, now it appears that the only way to close the form is to click the X in the top Right window.

I am using salesLogix 7.0.1

I have tried deleting the buttons on the managed form and adding a new button, with the modalResult mrNone, kind = bkCustom.
I have tried each of these commands in the code for the button with no success.
'Form.ModalResult = mrOK
'Application.BasicFunctions.CloseCurrentView False
'ModalResult = mrOK

Are there any special procedures to allow the form to close with code?

Thanks,

Tom Kaiser
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 07 11:54 PM
Try setting the modal result of the button to mrOK. Then no code should be required - just clicking on this button should close the form.
[Reply][Quote]
Tom Kaiser
Posts: 11
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 07 7:27 AM
I have tried setting the ModalResult of the button to mrOK and the form does not close. With the ModalResult set to mrOK, I have changed the Kind property from bkOK to bkCustom. Still, form does not close.

Thanks,

Tom
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 07 9:57 AM
Hi Tom,

Hope this isn't too basic, but the above advice is spot on...
Have you double checked that the script (to reset the modalResult = mrOK) is tied to the OK button Onclick event? In SLX, you have to manually hook your script to your control. (On the control's Properties | Events tab).

c
[Reply][Quote]
Tom Kaiser
Posts: 11
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 07 11:05 AM
Carla,

Thanks for your response. Did you notice that my question is about modeless manage form in SalesLogix 7.0.1?

I can use any of the above for a modal form which is displayed using ShowModal or DoInvoke. However for this modeless form, non of these have any affect:
Button properties:
ModalResult (mrNone, mrOK, mrCancel)
Kind (bkCustom, bkCancel, bkOK)
Cancel (checked or not checked)

On the button click event handler:

Form.ModalResult = mrOK
Application.BasicFunctions.CloseCurrentView False
ModalResult = mrOK

Still wondering if X is the only way out.

Thanks,

Tom
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 07 11:24 AM
Hi Tom,

I know I've closed modeless MainViews before by setting the ModalResult to mrOK. Not sure why it isn't working for you. You could always try using the ActiveView reference to see if that works:

Application.MainViews.ActiveView.Close


If that doesn't do it, here's one way that will work for sure. You can pass a reference of the MainView object itself to the MainView. Then you can just call it's close method to close the form. Here's how you will do that.

In the MainView, add the following OUTSIDE of any Sub. Just at the top of the script somewhere. You want this to be global in scope to the form so it can't be in any subs of functions.

Dim MainViewReference


Now in the code that invokes the MainView, you'll do this:

Dim mv

Set mv = Application.MainViews.Add("System:MyForm", 2, False)
Set mv.DetailsView.Script.MainViewReference = mv
mv.Show


In the MainView, the variable MainViewReference will contain a reference to the MainView object itself that you created to launch the form. You can use that now when you want to close the MainView by calling it's close method:

' close the main view...
MainViewReference.Close


Does all that make sense?
[Reply][Quote]
Tom Kaiser
Posts: 11
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 07 12:09 PM
Ryan,

Thanks for the response. Interesting methods.

Both methods close the Account Details main view. (The button to launch the modeless view is on an Account Tab.)

I suspect it is a matter of changing the reference so that the modeless form closes rather than the Account Details Main view.

Thanks,

Tom
[Reply][Quote]
Tom Kaiser
Posts: 11
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 07 12:46 PM
Oops...

The second method works exactly as Ryan described. (I had misplaced a line of code.)

(The first method still closes the Account Details Mainview).

Thank everyone for your responses!

Tom Kaiser
[Reply][Quote]
Michael Rogers
Posts: 70
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 07 7:54 AM
Carla,

Carefull with this one: I have seen SLX completely ignore a sub or function that had a free-form name (MyReallyCoolSub) that was then "selected" from the dropdown under Events. I tell my team to double click on the event for the control so that it "stubs out" the sub, then either call their sub from there or paste their code in that sub. You might get away 9 times out of ten, but that tenth time will make your life hell trying to figure out what is going wrong

Michael
[Reply][Quote]
Carla Tillman
Posts: 290
 
Re: Open a modeless formYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 07 11:13 AM

Thanks for the tip Michael!
I'll keep that in mind.

c
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/19/2025 4:28:27 PM