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 |