Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, February 19, 2025 
 
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 - SalesLogix .NET Extensions
Forum to discuss the use of .NET Extensions in SalesLogix version 7 and higher. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix .NET Extensions | New ThreadView:  Search:  
 Author  Thread: Have .Net Extension Working in VB Script but Have Syntax Errors Using in Legacy Basic Script
Brads99
Posts: 1
 
Have .Net Extension Working in VB Script but Have Syntax Errors Using in Legacy Basic ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
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!
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: Have .Net Extension Working in VB Script but Have Syntax Errors Using in Legacy Basic ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Sep 09 3:47 PM
Application.Managed.Create returns a string, so if it is failing, maybe it isn't able to find your .Net Form.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Have .Net Extension Working in VB Script but Have Syntax Errors Using in Legacy Basic ScriptYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[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 © 2025 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): 2/19/2025 4:32:45 PM