Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, November 27, 2024 
 
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: Problem with Dialog control when Converting a Legacy Basic Script to VBScript
Steve Margeson
Posts: 38
 
Problem with Dialog control when Converting a Legacy Basic Script to VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 10:55 AM
fiogf49gjkf0d
Problem with Dialog control when Converting a Legacy Basic Script to VBScript
In 5.2.3 I have a legacy script that is quite involved and I need to convert it to 6.1 VBS in preperation for 7.xx. I'm having a problem with a dialog control that I originally build at Run time with the original legacy block of code.

Begin Dialog(250, 250, 185, 70, strTitle) ' X,Y,W,H,Title
Text 10,10,155,30,strPrompt
Pushbutton 5, 40, 40, 14, "Yes", .PushYes '1
Pushbutton 50, 40, 40, 14, "Yes to All", .PushYesALL '2
Pushbutton 95, 40, 40, 14, "No", .PushNo '3
Pushbutton 140, 40, 40, 14, "No to All", .PushNoAll '4
End Dialog
Dim Dlg1 As YANA
Button = Dialog(Dlg1)


I'm trying to convert this in VBS and I figured I needed to use a Modal Form. I created a managed form Plug in and figured I could open it from script using the SetMV = Application.MainViews.Add("Ticket:Details:, 0, FALSE), but the Application.MainViews doesn't look like it is available in The 6.1 DEV Ref. They make a reference to ModalResault property of a command button but I can't find how to open the form in a Modal Mode.

Any ideas?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 12:26 PM
fiogf49gjkf0d
VBScript does not allow dialog creation like legacy basic did. You'll have to create a form plugin and invoke that instead.
[Reply][Quote]
Steve Margeson
Posts: 38
 
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 12:59 PM
fiogf49gjkf0d
I've tried creating the form but it looks like the Application.Mainveiws.Add is not available, I need to be able to open it in a Modal Mode so that I can get the return value from the form right?
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 1:06 PM
fiogf49gjkf0d
MainViews are only available in 6.2 and higher. For legacy it is easiest to just invoke the form, have it set the return values in globals and then grab the globals from the calling script.

Make sense?
[Reply][Quote]
Steve Margeson
Posts: 38
 
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 1:17 PM
fiogf49gjkf0d
I guess this one might be easier to develop in 7.x instead of converting it in 6.1, I just was looking at getting rid of a large legacy script and getting it into 6.1 in VBS since I have the time to work in 6.1.

Yes it makes sense, just call the Form and exit the script then restart the script where I left off when the user selects one of the buttons

Certainly would be easier to call a Dialog control or use the Application.Mainviews function
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 12 Feb 07 3:09 PM
fiogf49gjkf0d
I'm not so sure it would be easier, per se, just different.

Your code behind the modal screen (we'll say it's plugin name is "System:MyForm") would set the value in a global, like this:

Application.GlobalInfo.Add "g_MyGlobal", "Some value"


Your script that invokes the modal screen would look like this:

Dim val

Application.BasicFunctions.DoInvoke "Form", "System:MyForm"
val = Application.GlobalInfo("g_MyGlobal")
Application.GlobalInfo.Remove "g_MyGlobal"

If val <> "" Then
' do something with the return value here
End If


If you didn't want to use globals you could set a invokeresult.

In the form you'd do this:

Application.BasicFunctions.InvokeSetResult "Some value"


Then on the calling script you'd do this:

Dim val

Application.BasicFunctions.DoInvoke "Form", "System:MyForm"
val = Application.BasicFunctions.InvokeResult

If val <> "" Then
' do something with the return value here
End If


Make sense?
[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 © 2024 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): 11/27/2024 4:48:39 AM