This article contains all sample code, overviews, and screencasts from Ryan Farley's Nav 06 Sage summit presentation. This article includes a bonus screencast that will walk you through the process of embedding a .NET control in any version of SalesLogix. The concepts in this article and screencasts do not use the .NET Extensions feature of v7, but instead focuses on a generic way to include .NET in your SalesLogix development efforts.

In November of 2006 I presented at the Sage Summit conference in Nashville, TN. My topic covered how to leverage .NET in SalesLogix. Any version. Not just in version 7. This article provides the source code, screencasts of the demos, and even a sample screencast demonstrating how to embed a .NET control in SalesLogix from start to finish. These samples should work in versions 6.1 and higher of SalesLogix, the this concept can apply to any version of SalesLogix. The samples do not use the .NET Extensions feature in SalesLogix v7 but the concepts will still apply for .NET Extensions without some of the steps used in these samples.

Be sure to look at the end of this article for a special bonus screencast showing you the entire process, from start to finish, to embed a .NET control in SalesLogix! Click to jump there now!

Installing the Samples

To install the samples you will need to install the SalesLogix bundles and also register the .NET assemblies for COM interop on any machine where they will be used.

Install the bundles provided in the "_Bundles" folder.

Register the .NET assemblies for COM interoperability by using one of the following:

Open the .NET solution in Visual Studio and compile

or

Execute the batch file named "__INSTALL.bat" found in the "_Install Sample Binaries" folder.

An Overview of the Samples

The following screencasts will provide an overview of the samples. Use these to familiarize yourself with the samples, and their intent, to understand the samples better. Source code for all samples is provided at the end of this article.

The Advanced Contacts sample is an embedded .NET control. The embedded control is the XtraGrid control from DevExpress that is placed onto a tab under the account area in SalesLogix to provide an enhanced view of contacts for the account.

The Account Search sample places a custom .NET UserControl on the Account Detail screen in SalesLogix. The UserControl performs a search using the account name on Microsoft Live Search. The results are returned from Microsoft Live Search in XML and displayed in the UserControl to provide a quick internet search for the current account. The search is done on a separate thread so the movement from account to account is not delayed while waiting for the result.

The Account RSS sample sample uses a COM-exposed .NET assembly to provide easy access to an RSS feed for the current account which is displayed on an account tab built in Architect. The COM-exposed assembly nices wraps all calls to retrieve data from the RSS feed for the current account and simplifies the VBScript used to access the .NET object.

Contact Messenger sample turns SalesLogix into a Messenger client to communicate with contacts over the Microsoft Messenger network. All conversations are saved to history under the contact. The Contact Detail screen has been modified in Architect to add some visual parts of this sample, such as a button to initiate a conversation and an icon that changes to indicate whether the contact is online or not. The functionality is all provided by a COM-exposed .NET assembly that is referenced from the script behind the Contact Detail screen.

This sample is not meant to provide complete functionality. It can only initiate a conversation. It cannot receive a conversation initiated by someone esle. To use this sample, the e-mail address of the contact must match up with a contact already added to your messenger contact list on the account you log in with using the "Login" button in SalesLogix.

The following is a bonus sample screencast that will walk you through the entire process, from start to finish, of embedding a .NET control in SalesLogix. This sample will work on any version of SalesLogix from 6.1 to 7.0 and higher.

Note: The only thing that would prevent it from working exactly as shown is that in versions prior to 6.1 the SalesLogix form and SalesLogix controls did not have an HWND property. You could still do the same in earlier versions of SalesLogix, even back to the first release, but you would have to obtain the parent containers HWND using some other means.

Embedding a .NET ControlScreencast Details

View the screencast to see the entire process of embedding a .NET control in SalesLogix!

First of all, to all those who attended my session at Sage Summit, I appologize for the long wait for me to get these samples posted. Now that they are posted, take the time to understand the concept, no matter the version of SalesLogix you have. The concepts will apply regardless of version. If you are already on version 7, taking these concepts to the .NET Extensions feature will allow you to truly get the most out of your development experiences with SalesLogix. Use the forums on this site to discuss these concepts and receive any additional help you might need along the way.

Until next time, happy coding.

-Ryan

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.

Thanks for doing this. I followed it and I was able to open SLX and see the user control.

Two things though:

1. I deselected this new form, and clicked on the other Account forms. When I came back to this new one, only the hidden label with the AccountID was displayed. I had to ctrl F5 SalesLogix client to see the complete form again.

2. I have a form in VB.Net 2005 which is a time card form for field service engineers using the remote version of SalesLogix. Is there a way to use this form inside the SalesLogix client, so the form can syncronize?. We are in 6.2.4 right now. Plan to migrate to 7.2 next quarter.

To get the logged in user, you could either pass Application.BasicFunctions.CurrentUserID to the .NET code, or from the .NET code instnciate a SalesLogix.SlxApplication object and use BasicFunctions.CurrentUserID from there.

Hi Rayan, i am passing username,password from saleslogix to .net control, i am using the username and password in the form_load event of the Control.but i am not getting values.i am getting the values of the UserName and Password in Button_Click Event.i need those values in FormLoad Event.how to get the values in FormLoad Event,please help me. Thank's in Advance

Hi Rayan, i am passing username,password from saleslogix to .net control, i am using the username and password in the form_load event of the Control.but i am not getting values.i am getting the values of the UserName and Password in Button_Click Event.i need those values in FormLoad Event.how to get the values in FormLoad Event,please help me. Thank's in Advance

Hi Rayan, i am passing username,password from saleslogix to .net control, i am using the username and password in the form_load event of the Control.but i am not getting values.i am getting the values of the UserName and Password in Button_Click Event.i need those values in FormLoad Event.how to get the values in FormLoad Event,please help me. Thank's in Advance

Hi Rayan, i am passing username,password from saleslogix to .net control, i am using the username and password in the form_load event of the Control.but i am not getting values.i am getting the values of the UserName and Password in Button_Click Event.i need those values in FormLoad Event.how to get the values in FormLoad Event,please help me. Thank's in Advance

I signed up to this site just so I could give you some encouragement. It is incredibly generous of you to share this kind of information. It perfectly provides an elegant solution for SLX integration. Well presented and explained, exactly answering the need I have for facilitating integration in a project I am working on.

Ryan - My WniZip v 11 abends when I try to download the sample code. Is it possible your .zip file is corrupted? Below is the start of the WinZip dump diagnostics. I will send the complete dumpt to their support and see what they say.

Please include as detailed as possible a description of what you were doing before the problem occurred, so we can try to reproducethe problem here. In particular, please tell us what steps led to the problem, and whether it occurs always or sometimes after thesesteps are followed.

You can use these samples with .NET Extensions, the real difference is how you load them. Using Application.Managed just does some of the interop for you. I would suggest to look at the article on that to not get confused and then come back to these samples to tie the two together.

BTW, do you see errors trying these on 7.2? Or it just doesn't work? There's nothing that shouldn't work in 7.2 and later, the only possible thing that might need to change are the window class names in the SLX app where you are embedding your .NET app.

As far as the Interop.SalesLogix62.dll, that will still work on later versions as well (even up to 7.5.2) you just won't see anything that might have been added since 6.2 in the object model. Using an earlier version interop assembly is a great way to avoid making your addon version specific.

Nice examples Ryan. Question about the screencast embedding a .Net control in SLX. Can you pass a value back to the calling SLX form from the .Net control?

Thanks,

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...