Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, November 25, 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 - Legacy Development
Forum to discuss SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Legacy Development | New ThreadView:  Search:  
 Author  Thread: Reusing code in Legacy scripts
Sundari Sinha
Posts: 36
 
Reusing code in Legacy scriptsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Apr 10 10:50 AM
Hi,

In LEGACY DEVELOPMENT of SLX- is it possible to create a function and call it. I know in VBScipt you can do an include script.

I have a script that checks for the value of some fields and if the values are null or empty it raises an error and exit the sub. I have to use this validation in lot of places in my project. Is there a way I write this validation script/subroutine once and reuse it.

Any suggestions?

Thanks!
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Reusing code in Legacy scriptsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Apr 10 11:00 AM
Yes, you have to "Invoke" the Script.

I don't recall the exact syntax, as it has been a while since I had to use this, but it was something along the linse of:

Invoke "Basic", "Family:PluginName"


There is a replacement function on the new API called DoInvoke, which replaced the Invoke from the Legacy script, the syntax and usage is exactly the same.
[Reply][Quote]
Sundari Sinha
Posts: 36
 
Re: Reusing code in Legacy scriptsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Apr 10 1:12 PM
Thanks!!!
As always your input is highly appreciated.
[Reply][Quote]
Harry
Posts: 13
 
Re: Reusing code in Legacy scriptsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jul 10 10:15 PM
Here you go...

option explicit

sub Main

'Option-1
application.BasicFunctions.DoInvoke("Basic","Personal:MyScript")

'Option -2
Dim objBASIC
set objBASIC = Application.BASICFunctions
objBasic.DoInvoke("Basic","Personal:MyScript")

end sub
[Reply][Quote]
Harry
Posts: 13
 
Re: Reusing code in Legacy scriptsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 15 Jul 10 10:17 PM
I am sorry if I understand your question correctly you want to call Vbscript function from Legacy Script-? that would not be possible. You cannot call VB Script from legacy script you can only call Legacy script from VB Script. UNLESS THERE IS SOMETHING THAT I DON'T KNOW
[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/25/2024 7:36:31 AM