11/27/2024 6:23:55 AM
|
|
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!
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.
|
|
|
|
Problem with Dialog control when Converting a Legacy Basic Script to VBScript
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?
|
|
|
| |
| |
| |
|
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScript
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 |
|
|
|
Re: Problem with Dialog control when Converting a Legacy Basic Script to VBScript
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? |
|
|
|
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!
|
|
|
|
|
|
|
|