Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, April 16, 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!
 External Development Forums - General External Development
Forum to discuss general external development topic (related or not to SalesLogix development). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to General External Development | New ThreadView:  Search:  
 Author  Thread: Calling SLX Procedure with Parameters
Sim
Posts: 11
 
Calling SLX Procedure with ParametersYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Oct 06 12:50 AM
fiogf49gjkf0d
Hi all!

I'm trying to call a (custom made!) SLX Proc with Parameters from C#.
Unfortunately, i don't know how to do this.

I was able to create the SlxApplicationClass & ClientObjixClass.
But all of my attempts failed:
- .DoBasic("some code"); <- Can't call any of my VBscripts
- .DoInvoke("ActiveScript", "Personal:MyTestScript"); <- Works fine, but with no params

Any suggestions?

Thanks in advance,
Fellmer
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Calling SLX Procedure with ParametersYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Oct 06 12:42 PM
fiogf49gjkf0d
If you're invoking a VBScript plugin then you'll want to use globals to get the values passed in:

ie:

SalesLogix.SlxApplication slx = null;
try
{
slx = new SalesLogix.SlxApplicationClass();

slx.GlobalInfo.Add("MyGlobal1", "Some value");
slx.GlobalInfo.Add("MyGlobal2", "Some other value");
slx.BasicFunctions.DoInvoke("ActiveScript", "System:MyScript");
}
finally
{
Marshal.ReleaseComObject(slx);
}


Then you can pick those up in the script using the same:

Sub Main
Dim var1
Dim var2

var1 = Application.GlobalInfo("MyGlobal1")
var2 = Application.GlobalInfo("MyGlobal2")

' continue doing whatever...
End Sub


If you want to get a value from the script back to the C# code, the you can use global or set an InvokeResult from the VBScript.

ie: (in VBScript)
Application.BasicFunctions.InvokeSetResult "Some return value"


and then get it in the C# code:
slx.BasicFunctions.DoInvoke("ActiveScript", "System:MyScript");
string retval = slx.BasicFunctions.InvokeResult().ToString();


As another alternative, you can make your C# class visibile via COM interop and then pass a reference of it to the script (via a global) and then use it like any COM exposed object. That's a very clean way to go IMO.

(BTW, use only SlxApplication, not ClientObjix - that is only there for legacy)

Good luck.

-Ryan
[Reply][Quote]
Sim
Posts: 11
 
Re: Calling SLX Procedure with ParametersYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 19 Oct 06 1:18 PM
fiogf49gjkf0d
Hi Ryan

Wow, thanks a lot!
You made my day

I'll try both methods and choose the better one (for my case).

Thanks & Regards,
Fellmer
[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): 4/16/2024 1:25:23 AM