Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 18, 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: Undefined variable WScript - Trying to shell to external program
Steven Jowett
Posts: 10
 
Undefined variable WScript - Trying to shell to external programYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Jan 08 8:57 AM
What is wrong with this VBScript :-

option explicit
sub Main
'Get the current account's SLX record Id
Dim strAccountID
strAccountID = application.BasicFunctions.CurrentAccountID

'Open the Works Order builder to create a new works order for the SLX account, and if there is no
'associated Sales Ledger account, create one.
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("""C:\Program Files\Sage\MMS\PDM.Oilsense.Launcher.exe"" wopbuilder new " & strAccountID)
end sub

What I need to do is launch an exe program from a Step on a Sales Process.
When I click the link on the Step, an error is displayed which is :-

An error occurred executing active script (System:WOPBuilder).
Error calling method Main
Variable is undefined: 'WScript'
at line 9, char 5

Any help appreicated
Steve Jowett
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Undefined variable WScript - Trying to shell to external programYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Jan 08 2:22 PM
Drop the WScript object. Change from this:

Set WshShell = WScript.CreateObject("WScript.Shell")


to this:

Set WshShell = CreateObject("WScript.Shell")


Then is should work fine. You can read more and see a sample here: http://saleslogixblog.com/rfarley/archive/2004/02/10/331.aspx

-Ryan
[Reply][Quote]
Mark Dykun
Posts: 297
 
Re: Undefined variable WScript - Trying to shell to external programYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 13 Jan 08 9:17 AM
Hey Ryan,

I would think he would also have a problem with 'WshShell' not being defined as well. I cannot seem to see it in the declarations.

He has to add a

dim WshShell

Mark
[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): 8/18/2025 9:21:43 AM