11/25/2024 7:38:51 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 SalesLogix legacy development including views, scripts, etc.. View the code of conduct for posting guidelines.
|
|
|
|
Reusing code in Legacy scripts
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! |
|
|
|
Re: Reusing code in Legacy scripts
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. |
|
|
| |
|
Re: Reusing code in Legacy scripts
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 |
|
|
|
Re: Reusing code in Legacy scripts
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 |
|
|
|
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!
|
|
|
|
|
|
|
|