Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 22, 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!
 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: BaseRunnable not returning anything
Matt Bond
Posts: 4
 
BaseRunnable not returning anythingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Apr 13 1:23 PM
fiogf49gjkf0d

Here is my .NET code:


namespace TSS<br />{
 public class TSpUnlockUser : Sage.SalesLogix.NetExtensions.BaseRunnable
 {
  public override object Run(object[] Args)
  {
   object ReturnValue = string.Empty;
   MessageBox.Show("In TSpUnlockUser.Run() method", "TSpUnlockUser");
   return true;
  }
 }
}

 


Here is my SLX code:


<p>Dim namespace, title
Dim objTS
Dim result

 


title = "TSS"
namespace = "TSS"


Function UnlockTSpLogin(UserID)
    Dim result
    Dim args(0)
    args(0) = UserID


    On Error Resume Next


    objTS = Application.Managed.Create(title, namespace & ".TSpUnlockUser")
    'UnlockTSpLogin = Application.Managed.Run(objTS, args)
    result = Application.Managed.Run(objTS, args)
    if result is empty then result = "empty"
MsgBox "Unlock User Result = " & CStr(result), vbOK, "DEBUG"
    Application.Managed.Destroy objTS


    If Err.Number <> 0 Then
        MsgBox "Error = " & CStr(err.Number) & ":  " & Err.Description, vbOK, "TitleSphere Error"
    End If
    On Error GoTo 0
    UnlockTSpLogin = result
End Function


 


There are several issues here:



  1. The MsgBox in the SLX code is always shows "Unlock User Result = empty" even though I'm returning true. 

  2. The MessageBox in the .NET code never pops up. 

  3. Tthe SLX code is showing "Error = 424:  Object Required".  I've pin-pointed this to happening after Application.Managed.Destroy objTS (though the code to do that is not shown here).


Steps I've done to resolve:



  1. Changed the version on the .NET dll.

  2. After updating the binary, I've closed SLX completely and removed the old binary from %AppData%\SalesLogix\NETPlugins\<ServerName>\SALESLOGIX\Admin

  3. Released the .NET dll to Everyone.

  4. Logged back in to SLX as Admin to test.


Environment:



  1. SLX 8.0 network client environment only.

  2. Windows 7 64-bit (my .NET dll is build as x86).


 


What am I missing?

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: BaseRunnable not returning anythingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Apr 13 2:21 PM

Unfortunately guesses:


 public class TSpUnlockUser : Irunnable


 Fully define these momentarily:


objTS = Application.Managed.Create("TSS","TSS.TSpUnlockUser")


result = Application.Managed.Run(objTS, Array(args))


or


result = Application.Managed.Run(objTS, "0000")


 


What does that do ?


 


 

[Reply][Quote]
Matt Bond
Posts: 4
 
Re: BaseRunnable not returning anythingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Apr 13 3:10 PM

I changed to IRunnable instead of BaseRunnable and added the below to my code:


    [ClassInterface(ClassInterfaceType.AutoDispatch)]
    [ComVisible(true)]
    public class TSpUnlockUser : IRunnable
    {
        private Sage.SalesLogix.NetExtensions.SalesLogix.ISlxApplication _SlxApplication;
        private Sage.SalesLogix.NetExtensions.Licensing.ILicenseKeyManager _LicenseKeyManager;

 


        public void Initialize(Sage.SalesLogix.NetExtensions.SalesLogix.ISlxApplication SlxApplication, Sage.SalesLogix.NetExtensions.Licensing.ILicenseKeyManager LicenseKeyManager)
        {
            _SlxApplication = SlxApplication;
            _LicenseKeyManager = LicenseKeyManager;
        }


 ...


I also spelled out the namespaces instead of using variables.  I then used Array(args) in the Run parameter as you suggested.  No change.


 


I think remove the DLL from .NET Extensions, dropped it in C:\Program Files (x86)\SalesLogix, ran Regasm.exe against it with


/codebase

 switch, then change my SLX function to:


Set objTS = CreateObject("TSS.TSpUnlockUser")

result = objTS.Run(Array(args))

And now everything works.  Any explainations?


 

[Reply][Quote]
Matt Bond
Posts: 4
 
Re: BaseRunnable not returning anythingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Apr 13 3:31 PM

If I unregasm the file, my most recent code (above) acts the same way as the old code did.  It appears that SLX is not registering the DLL, so it can't find the class.  Does that help bring a solution to mind?


Thanks!

[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: BaseRunnable not returning anythingYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 11 Apr 13 6:35 PM

Not really, as - if it wasn't registered - then it shouldn't work at all ?

[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): 11/22/2024 4:53:40 AM