2/19/2025 3:58:13 PM
|
|
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 the use of .NET Extensions in SalesLogix version 7 and higher. View the code of conduct for posting guidelines.
|
|
|
|
Have .Net Extension Working in VB Script but Have Syntax Errors Using in Legacy Basic Script
Posted: 30 Sep 09 3:03 PM
|
I have succesfully implemented a .NET Extension in a Form, but am having trouble getting by a script error in a Legacy Form that uses Basic. Below is the VBScript Code:
Sub btn_HelloWorldClick (Sender)
Dim str_SSN Dim obj_Class1 Dim rl_Person_basicCollection Dim arr_Args (1) Dim guid
'---------------------------------------- ' Get Demographics for SSN '---------------------------------------- str_SSN = "xxxxxxxxx" ''' REAL SSN hidden for obvious reasons
'--------------------------------------- ' Load the .Net Extension ' Complain, if not GUID created & Exit '--------------------------------------- str_NetExt_Title = "SLX_ReliusDB" str_NetExt_Class = "SLX_ReliusDB.Class1" guid = Application.Managed.Create (str_NetExt_Title, str_NetExt_Class)
If LEN (guid) < 1 Then MsgBox (".NET Add-In: " + str_NetExt_Class + " was not loaded. Submit a Help Desk work order.") Exit Sub End If
MsgBox (guid) '''' For debugging
'--------------------------------------- ' Instantiate the .Net Extension '--------------------------------------- arr_Args (0) = "" set obj_Class1 = Application.Managed.Run (guid, arr_Args)
'--------------------------------------- ' Get_rl_Person_basic data '--------------------------------------- set rl_Person_basicCollection = obj_Class1.Get_rl_Person_basic (str_SSN)
MsgBox (rl_Person_basicCollection.FIRSTNAM)
'--------------------------------------- ' Destroy .Net Add-in '--------------------------------------- Application.Managed.Destroy guid
End Sub
Where I get the error is assigning the guid [ guid = Application.Managed.Create (str_NetExt_Title, str_NetExt_Class) ]. In the VBScript version, the guid appears to be a simple string.
If I Dim guid As String or As Object, I get "Error on line: xx - Object Required." Line xx is: guid = Application.Managed.Create (str_NetExt_Title, str_NetExt_Class)
I I Dim guid as Object and use a "set" (set guid = Application.Managed.Create (str_NetExt_Title, str_NetExt_Class), I get the same error "Error on line: xx - Object Required."
Any suggestions would be appreciated. Thanks! |
|
|
| |
|
Re: Have .Net Extension Working in VB Script but Have Syntax Errors Using in Legacy Basic Script
Posted: 30 Sep 09 3:50 PM
|
The object that is required that the error is referring to is "Application". This does not exist in legacy basic scripts (and therefore, Application.Managed cannot be used).
AFAIK, there is no way to invoke a .NET Extension from a legacy basic script directly. You'd have to put the code to use it in a VBScript plugin and then invoke that from the legacy script. You could take the object returned from the extension and place it in a global which I would assume you could retrieve and use in the legacy script. |
|
|
|
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!
|
|
|
|
|
|
|
|