Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, April 26, 2024 
 
Introduction to .NET in SalesLogix Version 7  
Description:  SalesLogix version 7 brings a whole new arena into the picture for SalesLogix developers. Version 7 allows for native support for .NET development. You can develop .NET assemblies and add them to the SalesLogix database. They can be bundles and even synchronize out to remotes. This new feature brings many new possibilities with what you can do with your SalesLogix development projects. This article will be the first in a series to provide an introduction to doing .NET development in SalesLogix version 7.

Category:  SalesLogix .NET Extensions Articles
Author:  Ryan Farley
Submitted:  5/12/2006
   
Stats: 
Article has been read 31734 times

Rating: - 4.7 out of 5 by 17 users
 

fiogf49gjkf0d
Introduction to .NET in SalesLogix Version 7

SalesLogix version 7 brings a whole new arena into the picture for SalesLogix developers. Version 7 allows for native support for .NET development. You can develop .NET assemblies and add them to the SalesLogix database. They can be bundles and even synchronize out to remotes. This new feature brings many new possibilities with what you can do with your SalesLogix development projects. This article will be the first in a series to provide an introduction to doing .NET development in SalesLogix version 7.


A New Horizon

We've reached a whole new horizon as SalesLogix developers. The door has been opened to move beyond what we are used to being able to do in typical SalesLogix customizations. With .NET support in SalesLogix version 7 we can accomplish so much more than we ever could before with forms and scripts built in the Architect. However, it is important to understand some things about what this really means to us as developers. Here's a run down, in a nutshell, of what this new functionality entails:
  • Use Visual Studio 2005 to craft a .NET assembly (exe or dll)
  • The classes in your assembly are "SalesLogix aware" by simply inheriting from a base SalesLogix class or implementing a SalesLogix interface (provided in a new DLL installed with SalesLogix)
  • You add your .NET assemblies to the SalesLogix system as plugins via a new .NET Extensions Manager tool
  • Add dependencies and other supporting files with your assembly (which all will also automatically sync out to remotes and be installed on all desktops as well)
  • You can bundle your .NET assemblies in standard SalesLogix bundles
  • The .NET assemblies will synchronize out to remotes and self-install
  • The .NET assemblies are easily invoked from SalesLogix scripts
  • You can easily pass parameters from SalesLogix scripts to the exposed classes your .NET assembly
  • You can easily return values or objects from the exposed classes in your .NET assembly to the calling SalesLogix script
  • The .NET assemblies used in SalesLogix can do basically whatever you want, from complex processing to launching forms to whatever
  • The SalesLogix Application object automatically referenced by your classes for your use in the .NET code
  • Built in support for licensing your .NET assemblies (more on this in a future article)
  • All using .NET 2.0 (which will now also be installed by the SalesLogix installation - awesome!)
This new feature in SalesLogix is called "SalesLogix .NET Extensions". There is really nothing to do with just "Forms". The feature is assembly based - which can include forms, but also just classes that perform some processing without any form at all. The opportunities are limitless for what is possible within the realm of creating and delivering .NET created customizations.


Your SalesLogix .NET Extensions Primer

Let's walk through the steps to perform a simple customization for SalesLogix using .NET. For this example we will keep things simple and just create a .NET class that displays a MessageBox and we will invoke this from a SalesLogix script (more complex examples to follow in future articles). Fire up Visual Studio 2005 and we'll get started.

For this example, let's create a "Class Library" project and we'll leave the default name of "ClassLibrary1". The first thing we need to do is add a reference to the SalesLogix library that contains the base class & interface that are available to inherit from to make the class "SalesLogix aware".
  1. To go the "Project" menu and select "Add Reference"
  2. In the Add Reference dialog, click the "Browse" tab
  3. Browse to the SalesLogix directory and add the DLL named "Sage.SalesLogix.NetExtensions.Framework.dll"
Now that we have a reference to the SalesLogix framework assembly, we either need to inherit from the "BaseRunnable" class or implement the "IRunnable" interface.


BaseRunnable and IRunnable

As I mentioned before, in order for your class to be "SalesLogix aware" you need to either inherit from the "BaseRunnable" class or implement the "IRunnable" interface. So what is the difference? Before we discuss that, let's go over what happens when your .NET assembly is loaded from SalesLogix. When SalesLogix loads your assembly it is not "executed", but instead loaded and the class contained in it (well, the class you specify when you load it) is instantiated inside a new AppDomain. The BaseRunnable class and IRunnable interface are the well defined entry points into your assembly. SalesLogix will use these entry points when loading the assembly. Once the class is instanciated by SalesLogix a reference to the SalesLogix Application object will be passed to your class along with a LicenseKeyManager object (which is used for licensing your assembly. This will be discussed in a future article).

The choice of whether to implement the IRunnable interface or inherit from the BaseRunnable class comes down to what other requirements you have for your class. A .NET class can only inherit from a single base class. So if your class needs to inherit from some other base class, such as System.Windows.Forms.Form for example, then you have no choice but to implement the IRunnable interface.

If you are going to inherit from the BaseRunnable class then you add it as the base class for the class in your project, however the BaseRunnable class has an abstract method (or MustOverride in VB.NET terminology) you must override. This abstract method, named Run, is what SalesLogix will call to start your code. This is your entry point, like "Sub Main" is for a VBScript. So far, your code will look like this if you are inheriting from the BaseRunnable class:

For C#:
namespace ClassLibrary1
{
    public class Class1 : Sage.SalesLogix.NetExtensions.BaseRunnable
    {
        public override object Run(object[] Args)
        {
            
        }
    }
}

For VB.NET:
Public Class Class1
    Inherits Sage.SalesLogix.NetExtensions.BaseRunnable

    Public Overrides Function Run(ByVal Args() As Object) As Object

    End Function
End Class

You will notice that the Run method returns an object. This is so you can return a value or object back to the calling SalesLogix scrip. If you don't need to return anything back then simply return null (or Nothing in VB.NET). You will also notice that there is an object array passed into the method. This is so the calling script can pass one or many parameters into your .NET class.

Now, let's say you decide to implement the IRunnable interface instead of inheriting from the BaseRunnable class. The interface defines two methods that you will need to implement. The "Run" method, which is the same as the abstract method we had to override before, and also an Initialize method. The Initialize method is where SalesLogix will pass a reference to the Application object to our class and we can store that in a private member. When we inherited from the BaseRunnable class this was done internally in the BaseRunnable class. The BaseRunnable class was a class that simply inherited from the IRunnable class and exposed the Application object passed into the Initialize method as a property. We have to do this ourselves when we implement the IRunnable interface. The code to implement this interface would look like this:

For C#:
using Sage.SalesLogix.NetExtensions;

namespace ClassLibrary1
{
    public class Class1 : Sage.SalesLogix.NetExtensions.IRunnable
    {
        private SalesLogix.ISlxApplication _SlxApplication;

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

        public object Run(object[] Args)
        {
            
        }
    }
}

For VB.NET:
Imports Sage.SalesLogix.NetExtensions

Public Class Class1
    Implements Sage.SalesLogix.NetExtensions.IRunnable

    Private _SlxApplication As SalesLogix.ISlxApplication

    Public Sub Initialize(ByVal SlxApplication As SalesLogix.ISlxApplication, _
        ByVal LicenseKeyManager As Licensing.ILicenseKeyManager) _
        Implements IRunnable.Initialize

    End Sub

    Public Function Run(ByVal Args() As Object) As Object _
        Implements IRunnable.Run

    End Function
End Class

Let's move on to create the rest of the project and do something useful.


The Hello World Sample Project

For our sample project we will inherit from the BaseRunnable class and display a MessageBox from our .NET class. Our code is simple and doesn't deviate too much from what we've looked at already, so let's just jump to the code:

For C#:
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)
        {
            string msg = "Hello .NET-SalesLogix World!\r\n\r\n" +
                         "Argument passed: " + (Args.Length == 0 ? "None" : Args[0].ToString()) + "\r\n" +
                         "Current userid: " + SlxApplication.BasicFunctions.CurrentUserID() + "\r\n" +
                         "Connection String: " + SlxApplication.ConnectionString;

            MessageBox.Show(msg, ".NET MessageBox");
            return null;
        }
    }
}

For VB.NET:
Imports System.Windows.Forms
Imports Sage.SalesLogix.NetExtensions

Public Class Class1
    Inherits Sage.SalesLogix.NetExtensions.BaseRunnable

    Public Overrides Function Run(ByVal Args() As Object) As Object
        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

Our .NET code is now complete. Let's take a look at how to get that into SalesLogix.


Adding the Assembly to SalesLogix

After compiling the code we created in the last section, we now have to add the assembly to SalesLogix so we can use it and it will be deployed to all SalesLogix clients. We can do this by launching the .NET Extensions Manager from the Architect (this can be found under the "Manage" menu. The .NET Extensions Manager can also be launched without going into Architect first by launching "SLXNetExtensions.exe" which is found in the SalesLogix directory (you will be prompted to log into a database).



The .NET Extensions Manager is split into three sections. The top displays a list of the .NET plugins (assemblies) in the database, the middle section contains tabe of related information about the selected plugin, and the bottom section is a log of actions performed and their outcomes. To add our assembly to the .NET Forms Manager, we simply right-click in the top section and then select "Add...". A browse dialog will appear and we browse to select our compiled assembly. If the assembly had other dependencies they would automatically be added as well. We can also add other related files if desired.

When we add our assembly, it is given a name or title based on the file name. This is how we will refer to the assembly from within SalesLogix. We can also select who to release the assembly plugin to as well from this same window by moving to the "Releases" tab and right-clicking to bring up the releases dialog. Should we wish to bundle the assembly we can also do it from here by selecting the "Deploy" menu.

The assembly has now been added to SalesLogix and we are ready to use it.


Using the Assembly from SalesLogix

To use the assembly, let's create a new SalesLogix form and add a button to it. In the script behind the form we will add the following code:

Dim ext ' this variable will hold the handle for the loaded .NET Extension

    ' instanciate the .NET Extension
    ext = Application.Managed.Create("SLX NET Extensions Test", "ClassLibrary1.Class1")

    ' run it (and pass any arguments)
    Application.Managed.Run ext, "Hello from Architect"

    ' destroy the loaded .NET Extension
    Application.Managed.Destroy ext

Let's analyze what that means. The Application now has a Managed class. This class exposes a "Create" method to load our .NET Extension, a method named "Run", which is used to "run" or invoke the class, and a "Destroy" method, which is used to destroy and unload the .NET Extension. We pass two parameters to the Create method. The plugin's Title and the fully qualified class name from our assembly (namespace and class name) and it returns a handle for us. When we call Run, we pass the handle and also a list of any arguments we want to pass to the code (If we don't want to pass anything we use Empty). Remember that we could also return a value from the .NET class which we would capture as the returned result from the call Managed.Run. When we are done with it we can destroy it by calling the "Destroy" method and pass it the handle. That is it. The end result is as follows:



We didn't do all that much here, but I can't tell you how excited I was to run that for my first time! Just awesome!


Wrapping it up

There are so many possibilities available with the support for hosting .NET inside of SalesLogix. A new day has come for us as SalesLogix developers. It is a great day - and this is only the beginning ;-)

Until next time, happy coding.
-Ryan


Updates

  • 9/25/2006 - Updated article for SalesLogix 7.0 Gold release syntax

 

About the Author

  Ryan Farley
(SalesLogix Business Partner)
Customer FX Corporation

fiogf49gjkf0d

Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix since 2001 and believes in sharing with the community. He loves C#, Javascript, Python, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

View Ryan's SalesLogix Mobile Seveloper Series
View Ryan's SalesLogix SData Developer Series
View Ryan's Git for the SalesLogix Developer series



View online profile for Ryan Farley
 

[ back to top] [ send to a friend]  

Rate This Article you must log-in to rate articles. [login here] 
 
Please log in to rate article.
 

Comments & Discussion you must log-in to add comments. [login here] 
 
Author Article Comments and Discussion
Ted Sturr



Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/13/2006 12:03:19 AM
fiogf49gjkf0d
Great article Ryan (as if you would produce anything less ;-)). I am looking forward to your future articles and insights on .Net and SalesLogix. Agree with you - it is a great new dawn that is approaching and a good day for SalesLogix developers.

Ted
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/13/2006 12:07:59 AM
fiogf49gjkf0d
Thanks Ted!
 
Christian B. Mortensen
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/15/2006 2:57:17 AM
fiogf49gjkf0d
wauuw, long waited functionality...
looking forward to v. 7 :)

thanks ryan!!!
 
Steve Knowles

slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/15/2006 9:08:26 AM
fiogf49gjkf0d
Interesting.. I have a project on the horizon involving recreating existing modification in the network client in the the web client. Will the ablility to work in .net in V7 make the process of maintaining the mods in the network client and the web client any easier? Could common code be called from the network and web client with this ability to work in .net? Thanks
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/15/2006 11:37:18 AM
fiogf49gjkf0d
Steve,

Well, the fact that you're writing your code outside of SLX would mean that you could reuse code in other areas, however there is nothing built into the Web Client that allows for any use of .NET assemblies. You would have you build your web customizations in ASP.NET in order to reuse code. So I guess the answer is "yes, but no". Hehe.

-Ryan
 
Christian Janelle
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/15/2006 2:58:48 PM
fiogf49gjkf0d
Ryan can you tell me if I can run your example with VB-NET Express 2005 or if I have to use the full version.

Thank-you
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/15/2006 3:00:50 PM
fiogf49gjkf0d
Christian,

Yes. It should work fine on Express (although I can't test to tell you for sure since I don't have Express installed anywhere)

-Ryan
 
Kevin Fullerton
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/16/2006 4:33:20 AM
fiogf49gjkf0d
Finally we might be able to get some decent source control working with SalesLogix.

Wonder if there are any plans to migrate to a full .NET version, where everything is .NET and available through Visual Studio?

Cheers!
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/16/2006 9:27:15 AM
fiogf49gjkf0d
Kevin, version 8 - code named Gila Monster :-D
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/22/2006 3:02:26 PM
fiogf49gjkf0d
FYI, this feature will be renamed from ".NET Forms" to ".NET Extensions" in the next release of v7. Yay!
 
Norman Rice



Re: Introduction to .NET in SalesLogix Version 7
Posted: 5/25/2006 2:59:28 PM
fiogf49gjkf0d
Thanks Ryan! You have been a wonderful help over the years.


Norm
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/25/2006 2:10:27 PM
fiogf49gjkf0d
Article has been updated for SalesLogix v7 Gold release syntax.

-Ryan
 
H.R Yadav
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 12/19/2006 12:33:59 AM
fiogf49gjkf0d

Great article Ryan ..................

HareRam Yadav
 
Norman Rice



Re: Introduction to .NET in SalesLogix Version 7
Posted: 1/3/2007 12:04:49 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
 
Preston Zappa
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/7/2007 9:15:22 AM
fiogf49gjkf0d
I've got the below to work, but I can't seem to get it to return a value..preferebly a string. Any ideas?

C#:

public class Class1 : Sage.SalesLogix.NetExtensions.BaseRunnable
{
public override object Run(object[] Args)
{
string msg = (Args.Length == 0 ? "None" : Args[0].ToString());
string msg2 = (Args.Length == 0 ? "None" : Args[1].ToString());
MessageBox.Show(msg + "-" + msg2, "Test Message Box");


SLXTransWebSvc.SLXTransWebSvc t = new SLXTransWebSvc.SLXTransWebSvc();
string result = t.LoadStaging("200701");


return result;
}
}

SLX Code:

Dim ext ' this variable will hold the handle for the loaded .NET Extension
Dim args(2)
' instanciate the .NET Extension
ext = Application.Managed.Create("SLXTEST", "SLXTEST.Class1")
args(0) = "TestParam1"
args(1) = "TestParam2"
' run it (and pass any arguments)
Application.Managed.Run ext, args

' destroy the loaded .NET Extension
Application.Managed.Destroy ext



Thanks! --Preston
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/7/2007 12:17:42 PM
fiogf49gjkf0d
Hi preston.

I don't see anywhere in your SLX code where you are capturing the return value. Assuming that the line:

string result = t.LoadStaging("200701");


Really is returning a value into "result" (where you later return), you should be able to get that value in SLX by modifying the line:

Application.Managed.Run ext, args


to the following:

myResult = Application.Managed.Run(ext, args)


the variable "myResult" would now contain the return value. Make sense?
 
Faisal
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/29/2007 4:10:34 AM
fiogf49gjkf0d
Hi Ryan,

I have never developed for SalesLogix before. I mostly do Sage MMS, Line500, Sage1000 development and standalone Win32 apps.

I must say however your 'Tutorial' if I can call it that was amazing. Right to the point, simple enough to follow and detailed enough to get the job done. it allowed me integrate my .NET dll's into SalesLogix perfectly.

Many thanks for sharing your knowledge!
Faisal
 
Craig Herder
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/30/2007 10:18:12 AM
fiogf49gjkf0d
Ryan,

Thanks for this article! It's very informative, and easy to understand... But I would like to ask you a related question.
If you are familiar with MAS500.... I've been told that the Business Insights Analyzer is just .NET control that runs off of
a Sequel view.... Do you, or does anyone else know what I would need to include or do to reference the BIA in the SalesLogix .NET extension manager, in order to run the BIA from within SalesLogix, on a workstation where the MAS500 Desktop is installed?

Thanks.
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/30/2007 10:31:35 AM
fiogf49gjkf0d
Hi Craig,

I do know that the BIA is comprised of .NET and SQL views, but I don't know more about it than that. I've never used it or anything. Taking SLX out of the picture, how would you use it normally? Is it just a .NET assembly that you would add a reference to normally? If that is the case you'd just reference it by your .NET Extension and it would get pulled in as a reference by the .NET Extension Manager (so you're not exactly adding the BIA to the .NET Extension manager, you're adding it to your own .NET project - it is your .NET project that uses the BIA that gets added to the .NET Extension manager)

Hope this helps.

-Ryan

Hope this helps.
 
Craig Herder
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/30/2007 11:10:03 AM
fiogf49gjkf0d
Thanks Ryan,

I hear what you are saying. I just thought that perhaps there was a way to do it directly via the DNEM. I will look for some help on coding the assembly to call it. Any suggestions on where to look?

TIA.
 
Matt Ryan
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 6/25/2007 10:11:28 AM
fiogf49gjkf0d
Hi Ryan,

I'm very interested in using .NET extensions in our next project. I've used the same code but my call:

guid = Application.Managed.Create("SLXinterfacesAdapter","SLXinterfacesAdapter.PAIS")

... returns blank. I've quadruple checked my set up in the .NET extentions manager and it appears right and has a guid value. Also the "title" and "class" parameters are definitely entered accurately in the .Create() call. Any suggestions why it's failing to find my class?

Thanks!
-- Matt
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 6/25/2007 12:17:22 PM
fiogf49gjkf0d
Hi Matt,

If the returned value from Application.Managed.Create is blank that would most likely mean one of two things:

1) The "Namespace.Classname" for the assembly or the "Title" as defined in the .NET Extentions manager do not match with the code you're using to invoke it. Double check that.

2) The .NET Extention files did not get properly registered on the machine you're testing on. If this is the case, you can fix this by manually running the batch file named "RegisterSLXNetExtentions.bat" found in the SalesLogix directory.

Give those a try.

-Ryan
 
Matt Ryan
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 6/25/2007 3:04:57 PM
fiogf49gjkf0d
Thanks Ryan!

Suggestion #2 was magic. I'm off and running into my own set of bugs. Thanks again.
 
Sean Conlon
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 8/6/2007 8:45:59 AM
fiogf49gjkf0d
Awesome article, but I am having a problem with the .NET Extension manager crashing. When I open it, it crashes and the error report says there is an uncaught System.IO.DirectoryNotFound exception. Do you have any ideas?
 
FoolBallFan
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 1/2/2008 8:06:43 AM
fiogf49gjkf0d
Can we use Visual Studio 2005 to debug and/or trace the Class/DLL, the same way as we do with other Class/DLL?
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 1/2/2008 11:27:14 AM
fiogf49gjkf0d
Hi FoolBallFan,

Yes, you sure can. I've outlined the steps on my SalesLogix related blog here: http://saleslogixblog.com/rfarley/archive/2007/08/20/37982.aspx

-Ryan
 
Tracy
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 4/8/2008 3:52:47 AM
fiogf49gjkf0d
hi Ryan
I have a problem,please give me a hand .

try
{

string constr= "Provider=SLXOLEDB.1;Password=\"anyuecrm\";Persist Security Info=True;User ID=admin;Initial Catalog=anyue4-1;Data Source=ck2602;Extended Properties=\"PORT=1706;LOG=ON;CASEINSENSITIVEFIND=ON;AUTOINCBATCHSIZE=1;SVRCERT=;\"";

System.Data.OleDb.OleDbConnection o_con = new OleDbConnection(constr);
o_con.Open();
}
catch(Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.Message.ToString());
}


The error of connection.
Error: "There is not available information that is incorrect:E_UNEXPECTED( 0x8000FFF)
 
Preston Zappa
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 4/8/2008 10:52:11 AM
fiogf49gjkf0d

Try replacing :
System.Data.OleDb.OleDbConnection o_con = new OleDbConnection(constr);

with
System.Data.OleDb.OleDbConnection o_con = new System.Data.OleDb.OleDbConnection(constr);

 
Jason Lindsay



Re: Introduction to .NET in SalesLogix Version 7
Posted: 6/4/2008 12:48:55 PM
fiogf49gjkf0d
I'm wondering how exactly the .NET extensions deploy out to the client. Do the dll's have to reside physically on each remote computer for them to work correctly in the client, or can they simply be invoked from the server? We have some extensions that are working correctly for some users, but not working at all for others, and we can't seem to isolate the problem to the existence of the extension dll files on individual workstations.

Being new to the SalesLogix environment, I'm a little confused on exactly how these extensions are deployed.

Thanks!
Jason Lindsay
Unison, Inc.
 
Jeff Ballard
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 6/26/2008 6:31:22 PM
fiogf49gjkf0d
Ryan,

Do you know if you can use the 3.5 framework in an extension? Obviously it would be required to be installed on the users machines, but the 3.5 framework really is just the 2.0 with extensions added, so I would think that the "Sage.SalesLogix.NetExtensions.Framework.dll" would fit into a VS 2008/3.5 project fine. I don't expect you to do my legwork and try it, but I was curious if you have.

Thanks,

Jeff
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 6/26/2008 6:36:05 PM
fiogf49gjkf0d
Hi Jeff,

Yes, you can use .NET 3.5 as an extension. Works fine.

-Ryan
 
Simon Boyd
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/22/2008 10:06:53 AM
fiogf49gjkf0d
Great article, but I'm having trouble with this example on our Saleslogix system (7.2.0.1501)

I have followed the steps in this article closely, including the suggestions in the comments, but I am getting the following error when instantiating the extension from the Saleslogix button event:

Script Error
An error occurred executing active form script (System:HelloWorld)
Error calling method btnHelloClick

Unsupported provider version

at line 12, char 5

This seems to be at the Application.Managed.Create call. The full script (with line numbers) is:

1
2
3 option explicit
4
5 dim ext ' this variable will hold the handle for the loaded .NET Extension
6
7 Sub btnHelloClick(Sender)
8 ext = ""
9
10 msgbox "Application.Managed.Create(""HelloWorld"", ""ClassLibrary1.Class1"")"
11 ' instantiate the .NET Extension
12 ext = Application.Managed.Create("HelloWorld", "ClassLibrary1.Class1")
13 msgbox "ext=" & ext
14 ' ext = Application.Managed.Create("", "")
15
16 ' run it (and pass any arguments)
17 Application.Managed.Run ext, "Hello from Architect"
18
19 End Sub
20
21
22 Sub AXFormClose(Sender)
23 if ext <> "" then
24 ' destroy the loaded .NET Extension
25 Application.Managed.Destroy ext
26 end if
27 End Sub

The msgbox call at line 13 is never reached. I created the class library with Visual Basic 2005 Express. There is no mention of what provider or version is involved.

Any suggestions would be greatly appreciated.

Simon
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/22/2008 10:58:22 AM
fiogf49gjkf0d
Hello Simon,

Are you sure your .NET Extension title is "HelloWorld"? It seems strange that this would be your title when your fully-qualified classname is "ClassLibrary1.Class1". That seems to be the most logical thing that could be causing the problem.

However, the error "Unsupported provider version" is quite odd and doesn't really match that. Can you check that the version of SLX that the extension was created with is the same as what you're using it on? Meaning the versions of "Sage.SalesLogix.NetExtensions.Core.dll" and "Sage.SalesLogix.NetExtensions.Framework.dll" used in your .NET project *match exactly* with the version of SLX you're using the extension on.

-Ryan
 
Simon Boyd
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/25/2008 8:11:00 AM
fiogf49gjkf0d
Hi Ryan,

Thanks for the reply. I should say that I'm new to .NET and SLX (my background is Java and VC++).

"HelloWorld" is the title shown in the .NET extensions manager (it's the Assemby Name and Title I gave it in the VB project properties). I also checked the "Make assembly COM-Visible" option. From the previous comments, if this is not correct then the Application.Managed.Create would not return a value. Instead I get the "unsupported provider version" error.

I've checked the NetExtensions DLLs in C:\Program Files\SalesLogix directory:
Assembly version=7.2.0.1501 for both.
I had copied the Sage.SalesLogix.NetExtensions.Framework.dll from here to include in the VB project so the assembly version is identical. Do I need Sage.SalesLogix.NetExtensions.Core.dll as well?
Is SalesLogix picking up a DLL with a different assembly version from somewhere? Is there a .NET dependency on some other assembly?

Simon
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/25/2008 9:19:42 AM
fiogf49gjkf0d
Simon, what version of SLX are you on?
 
Simon Boyd
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/25/2008 9:25:42 AM
fiogf49gjkf0d
Ryan,

Sorry, should have mentioned, SLX client shows version 7.2.0.1501, same as the DLL assembly versions.
 
Simon Boyd
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/30/2008 6:04:10 AM
fiogf49gjkf0d
Update:

I've tried building the .NET class library using Visual C# 2005 Express. Still get the 'unsupported provider version' error. Thought this might be because I'm using the 'Express' version.

Now it gets really strange. I removed all the .NET extensions in the .NET extensions manager, then retried the form from the SLX client. I thought I would get some other error, but I'm still getting THE SAME ONE: 'unsupported provider version'.

I'm totally confused. Any ideas?
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 9/30/2008 10:03:33 AM
fiogf49gjkf0d
Hello Simon,

By chance, is this on a 64-bit machine? BTW, we should probably move this to the forums.

-Ryan
 
Simon Boyd
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 10/7/2008 3:23:08 AM
fiogf49gjkf0d
Ryan, I think it's 32 bit but I'm not 100% sure.
 
Erdem
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 12/2/2008 3:35:47 PM
fiogf49gjkf0d
Instead of calling the command
Application.Managed.Destroy ext
to destroy the loaded .Net extension is there a way to have the .net extension destroy itself on a particular event in the extension?

For instance say i have a phone dialer that is called on a click event in an account form. It then monitors the call for various stats like time it took to ring, busy signal, duration of call. On a disconnect event I write to a table all the pertinent details and would like to destroy the .net extension. If i call destroy in Architect after run the extension no longer monitors all the events.
 
Andy Sutherland
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 3/18/2009 4:02:25 PM
fiogf49gjkf0d
If you get an error "invalid class string" returned from the client on a particular machine but the .net extention works on other machines. Run the batch file RegisterSLXNetExtentions.bat on the affected machine to fix it (located in Saleslogix directory) . I got this right from SLX SDK support worked great!
 
jose
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 11/6/2009 5:34:22 PM
fiogf49gjkf0d
hi all
i am working with saleslogix 7.5.
i create the exact test in vb2005 and runned directy on the slx server and it work perfect, tested on another computer in the same network and i get this error
that assembly does not allow partially trusted callers at slxobj.slxmain..ctor()
the action that failed was
linkdemand
the assembly or appdomain htat failed was: slxob version 1.0.0
the zone of the assembly htat failed wad:
intranet
the url . . . .

if any one has any idea
i will really thank them
its an emergency

all the code work on develop computer and server but on production only work directly on the main slx server
 
RJ Samp

slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 1/10/2010 9:13:05 AM
fiogf49gjkf0d
This doesn't work in 7.22 as is....any ideas on what I need to change? I click on the button in SLX Client, I guess nothing executes on the .NET side (although msgbox's on the SLX side are working fine).
 
Ryan Farley

slxdeveloper.com Site Administrator
slxdeveloper.com Forum Top 10 Poster!

Re: Introduction to .NET in SalesLogix Version 7
Posted: 1/10/2010 10:42:03 AM
fiogf49gjkf0d
RJ,

Could it be that .NET Extensions didn't get properly registered on the machine you're on? Have you tried running the RegisterSLXNetExtentions.bat file to ensure things are registered? Try that, these should work on 7.2.

-Ryan
 
AUser
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 11/18/2011 10:17:19 AM
fiogf49gjkf0d

Hi Ryan,


Fantastic example, so many thanks for that.


Got your above example working on a 7.5.3 32 bit environment but cannot for the life of me get it working on a 64 bit server..I've run RegisterSLXNetExtentions.bat manually but still no joy.  No errors are reported it just doesn't appear to call the .Net dll.


Have you had any experience with the above on 64 bit machines ?


many thanks.

 
steve yang
 

Re: Introduction to .NET in SalesLogix Version 7
Posted: 12/8/2014 2:50:40 PM
fiogf49gjkf0d

Hi Ryan,


I am new to Slx development. As a long time .net developer this article clicked with me well; I was excited to have someone like you leading the way to leverage .net in SalesLogix coding world. This article was well written and instruction easy to follow. But somehow, it did not work on SalesLogix client side when I added the extension and tried to call the CreateObject. I am running on a 64-bit machine and I saw someone posted the same question about not working on a 64-bit machine. Was that true? What is the way out of this? My SalesLogix client is at version 7.5.2.2151.


 


 


I know it has been a while you wrote this piece, but I am desperately in need for some guidance so I am hitting every path I can find.


 


Thanks so much!


 


 

 
 

       Visit the slxdeveloper.com Community Forums!
Not finding the information you need here? Try the forums! Get help from others in the community, share your expertise, get what you need from the slxdeveloper.com community. Go to the forums...
 



 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): 4/26/2024 10:36:13 AM