6/7/2025 12:22:38 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.
|
|
|
|
Cannot run .NET Extension
Posted: 13 Nov 06 9:42 PM
|
fiogf49gjkf0d hi,
I tried replicating the extension in the article "Introduction to .NET in SalesLogix Version 7" word to word, but it did not execute.
Then I tried a couple of another things to troubleshoot.
1. This is the code on the Account Form:
Sub Button1Click(Sender) msgbox "Loading .NET extension"
dim ext ext = Application.Managed.Create("SLX NET Extensions Test", "ClassLibrary1.Class1") Application.Managed.Run ext, "Hello from Archtect" Application.Managed.Destroy ext
msgbox "Finished successfully..." End Sub
The 2 messageboxes showed one after the other but with no response from the middle 4 lines.
2. Removed the plugin from .NET Extensions Manager. This time there were no errors also about not finding the plugin.
Was wondering whether there was something else I should be doing in SLX7. Any help would be greatly appreciated.
Regards
Ashish.
|
|
|
|
Re: Cannot run .NET Extension
Posted: 14 Nov 06 6:01 AM
|
fiogf49gjkf0d I had alot of issues in running this the first time also. Recommend you use a msgbox to see if a GUID (ext) is returned by the Mananged.Create command. My guess it is comming back empty. I have found that the entries in the Create command must be exactly like your .Net Manager and it is case sensitive. Try cutting and pasting the entries from your Visual Studio App into your SLX app. Not sure if this is your issue but it was what was driving me crazy.
Ray |
|
|
|
Re: Cannot run .NET Extension
Posted: 14 Nov 06 9:09 AM
|
fiogf49gjkf0d The first thing to check is to make sure your namespace.classname is correct, and that you're using the correct "title" for the extension.
Also, I've had an issue where the extension wouldn't load until after I shut down the client (after loading the .NET assembly into the extensions manager).
-Ryan |
|
|
|
Re: Cannot run .NET Extension
Posted: 03 Jan 07 12:06 PM
|
fiogf49gjkf0d I got this to work by changing
' instanciate the .NET Extension ext = Application.Managed.Create("SLX NET Extensions Test", "ClassLibrary1.Class1")
to
' instanciate the .NET Extension ext = Application.Managed.Create("ClassLibrary1", "ClassLibrary1.Class1")
for c#
Thanks again Ryan!
Norm |
|
|
|
Re: Cannot run .NET Extension
Posted: 09 Apr 07 6:33 PM
|
I am still having problems getting this to work even after I confirmed that my namespace.classname is correct and changing the title to match the namespace.
What other methods can you use to confirm that everything is registered and released properly to make it work?
Also is this like other plugins and you can test as the admin, I released it to everyone and cannot get this to work even as another user.
Thanks
Nathan |
|
|
|
Re: Cannot run .NET Extension
Posted: 09 Apr 07 10:28 PM
|
Hi Nathan,
What exactly is going wrong? What does your SLX script look like? What does your .NET code look like?
-Ryan |
|
|
|
Re: Cannot run .NET Extension
Posted: 10 Apr 07 7:10 AM
|
I am getting nothing from SalesLogix, and I am also not getting a guid from the .net extension when I create it.
Here is my .NET code
using System; using System.Windows.Forms; using Sage.SalesLogix.NetExtensions;
namespace ClassLibrary1 { public class Class1 : Sage.SalesLogix.NetExtensions.BaseRunnable { public override object Run(object[] Args) { MessageBox.Show("Test" + SlxApplication.ConnectionString); return null; } } }
And here is my SalesLogix code:
option explicit
Sub Button1Click(Sender)
msgbox "Loading .NET extension"
dim ext
ext = application.Managed.Create("ClassLibrary1","ClassLibrary1.Class1")
msgbox ext
application.Managed.Run ext, "Hello
msgbox "Finished successfully..."
End Sub
I added it through the .net manager and released it to everyone.
Thank You,
Nathan |
|
|
|
Re: Cannot run .NET Extension
Posted: 10 Apr 07 10:56 AM
|
Can you confirm that "ClassLibrary1" is the title of the extension when added to the extensions manager?
What happens when the script runs? Anything? Does it produce any errors or just nothing happens?
You mention that you are not getting a guid after the call to create. This would indicate that the title and/or namespace.classname is not correct in your VBScript code. The namespace.classname look correct from your code, are you sure the title is correct?
One last thing to try. I have seen in some cases where the .NET extension libraries do not get properly registered from the install. If this is your case then you can register them manually by running the batch file named "RegisterSLXNetExtentions.bat" that can be found in the SLX directory. |
|
|
| |
|
Re: Cannot run .NET Extension
Posted: 10 Apr 07 12:21 PM
|
Originally posted by Nathan Foster
Running the bat file did it, thank you for helping with this. |
|
Great to hear. Glad it is working now! |
|
|
|
Re: Cannot run .NET Extension
Posted: 09 May 07 8:22 AM
|
fiogf49gjkf0d Hi Ryan,
I'm having a similar issue where i cannot view info from my .dll
This is my .net Code
Imports AMLInterface.AMLInterface Imports System.Collections Imports System.Data Imports Sage.SalesLogix.NetExtensions Imports System.Runtime.InteropServices
Namespace slxWebservice Public Class Class1 Inherits Sage.SalesLogix.NetExtensions.BaseRunnable
Public Overrides Function Run(ByVal Args() As Object) As Object Dim x As Integer x = 10 Return x End Function End Class End Namespace
My SLx Code:
Sub Button1Click(Sender) dim loader dim i stop loader = Application.Managed.Create("ClassLibrary1","slxWebservice.Class1") i = Application.Managed.Run(loader, "") msgbox i
End Sub
my Loader value is blank. I've made sure the Sage.NetExtensions are registered, my namespace and classname is correct, but i get nothing back. i even went as far as hardcoding a return value in .net.
Hope you could point me in the right direction.
Rgds, Daryn
|
|
|
|
Re: Cannot run .NET Extension
Posted: 09 May 07 11:11 AM
|
fiogf49gjkf0d Hi Daryn,
Is the "Title" value for your extension (in the .NET Extensions Manager) "ClassLibrary1"? If your loader var is blank then it's obiously not loading/finding your extension. I'd start there. Also, maybe try exiting SLX and restarting to see if it has any better luck loading it?
-Ryan |
|
|
|
Re: Cannot run .NET Extension
Posted: 09 May 07 3:39 PM
|
fiogf49gjkf0d Hi Ryan,
Thanks for your response, much appreciated. I am just a little confused, In VS'05, i have an assembly name for my project called ABC123, and within that, there is a class called ClassLibrary1.
You refer to Title (.net Extensions Manager), which, when i load the dll into it, takes the Assembly name of my .dll.
If i create the object using the Title which is in the manager it gives me some error saying it cannot find the Class. If i use the name of the class within the Assembly, which in this case is classLibrary1, then no error, but at the object stays blank.
This is really confusing for me at this stage.
Thanks Daryn
|
|
|
|
Re: Cannot run .NET Extension
Posted: 10 May 07 3:03 AM
|
fiogf49gjkf0d Hi Ryan,
I got it eventually thanks. Used the following: Create(Title,ClassName.Namespace.Class)
Thanks
Rgds, Daryn |
|
|
|
Re: Cannot run .NET Extension
Posted: 10 May 07 3:51 AM
|
fiogf49gjkf0d Hi, Sorry, my previous post was slightly incorrect.
loader = Application.Managed.Create(Title,Rootnamespace,ClassNamespace.Class)
Works like a charm
Regards, Daryn |
|
|
|
Re: Cannot run .NET Extension
Posted: 01 Aug 07 5:51 AM
|
Hi Daryn, i tried to implement the solution that you suggested above , ie,
loader = Application.Managed.Create(Title,Rootnamespace,ClassNamespace.Class)
but, it is giving the error that Create method is passed with invalid number of arguments, since it accepts only 2 arguments. But one interesting thing is, i am able to get the GUIDI(ext), its not empty, ie, ext = Application.Managed.Create("WindowsApplication1","WindowsApplication1.Form1") msgbox ext here, the value of ext is not empy, it has some GUID value. Any other solutions to get it worked??
Thanks in advance |
|
|
|
Re: Cannot run .NET Extension
Posted: 01 Aug 07 12:26 PM
|
the Create method in Application.Managed does take only two parameters. The correct syntax to use is "Title" for param 1 (which is what displays in the Title column in the .NET Extensions Manager) and the Namespace.Classname for the second param.
What does your complete code look like? |
|
|
|
Re: Cannot run .NET Extension
Posted: 02 Aug 07 12:35 AM
|
Ryan, My complete code looks like as below, in the .Net form,
Imports System Imports System.Windows.Forms Imports Sage.SalesLogix.NetExtensions Public Class Form1 Implements Sage.SalesLogix.NetExtensions.IRunnable
Private SlxApplication As SalesLogix.ISlxApplication
Public Sub Initialize(ByVal SlxApplication As Sage.SalesLogix.NetExtensions.SalesLogix.ISlxApplication, ByVal LicenseKeyManager As Sage.SalesLogix.NetExtensions.Licensing.ILicenseKeyManager) Implements Sage.SalesLogix.NetExtensions.IRunnable.Initialize
End Sub
Public Function Run(ByVal Args() As Object) As Object Implements Sage.SalesLogix.NetExtensions.IRunnable.Run Dim msg As String = "Hello .NET-SalesLogix World!" & vbCrLf & vbCrLf & _ "Argument passed: " & IIf(Args.Length = 0, "None", Args(0)) & vbCrLf & _ "Current userid: " & SlxApplication.BasicFunctions.CurrentUserID() & vbCrLf & _ "Connection String: " & SlxApplication.ConnectionString
MessageBox.Show(msg, ".NET MessageBox") Return Nothing End Function End Class
********************************And in Sales Lgoix Architect,
Sub Button1Click(Sender)
Dim Ext
Ext = Application.Managed.Create ("WindowsApplication1","WindowsApplication1.Form1") Application.Managed.Run Ext,"Hi" Application.Managed.Destroy Ext
End Sub
Here, when open Sales Logix Client and click on button1, i am not able to get the messagebox displaying the userid, connectionstring and also not able to show the Form1.
My actual requirment is, I want to design a windows form in .Net and show that form in the Sales Logix on a button click so that i can perform some business functionality in .Net form from Sales Logix. For that, i have written above code, but it didn't display anything, and also no error message. For your informaion, the Ext value is NOT blank, it displays some GUID value, means Application.Managed.Create method works fine, may problem with Application.Managed.Run method, not sure.
Any ideas to acheive this?
Thanks,
|
|
|
| |
|
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!
|
|
|
|
|
|
|
|