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: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnable
Alex
Posts: 11
 
SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Jul 14 4:40 AM

Hello,


I have Project in Visual Studio, where is Windows Form. My project`s type is Windows Application (i have tried Class Library too), and using .NET Framework 4.0 (because SLX.Framework doesn`t want lower version of framework)


And i am trying to run it in the Saleslogix v8.0. SLX wanted very hard that i implements IRunnable, so i did, but i don`t know how to put it inside the SLX form.


I can run it as separated window.


How to run my .Net Extension in Saleslogix form?




Visual Studio C# code:


 


public class Program : MarshalByRefObject, IRunnable

 


        {


                    private Form1 _customerInfoForm;


                    private ISlxApplication _SlxApplication;


                    public void  Initialize(ISlxApplication SlxApplication, Sage.SalesLogix.NetExtensions.Licensing.ILicenseKeyManager LicenseKeyManager)


                    {


                        _SlxApplication = SlxApplication;


                        _customerInfoForm = new Form1();   //SLX only running this part of code ( Initialize )


                        _customerInfoForm.Show();


                    }


                    public object Run(object[] Args)


                    {


                        _SlxApplication.BasicFunctions.GlobalInfoSet("EventOwner", (string)Args[0]); //I don`t know why, he doesn`t start public Run


                        _customerInfoForm = new Form1();


                        _customerInfoForm.Show();


                        return this;


                    }


}


 




Saleslogix code:


 


 Dim ext

ext = Application.Managed.Create("Krediidiinfo", "Krediidiinfo.Program")

Application.Managed.Run ext, null


 


 

[Reply][Quote]
Alex
Posts: 11
 
Re: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 04 Jul 14 4:28 AM

Can someone post here code example, which is using IRunnable ?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 14 1:05 AM

If what you are referring to is embedding your .NET form inside a SLX form, this library will make that task easy for you. https://github.com/CustomerFX/NetExtensionsHelper


This library allows you to create a .NET UserControl and embed in a SLX form pretty easily. Source is available if you just wanted to see how to do the embedding and the pinvoke calls required.

[Reply][Quote]
Alex
Posts: 11
 
Re: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 14 1:33 AM

It`s is not so easy.


Those samples are using Framework 2.0, if i will add reference from my Saleslogix 8.0 (NetExtenstions.Framework), then it wants Framework 4.0.


If i used lower version of Saleslogix, then it would be great, but i tried it already, even Your samples, where are Contacts, they doesn`t work on SLX 8.0.


Am i missing something?

[Reply][Quote]
Alex
Posts: 11
 
Re: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 14 1:53 AM

Here is a little code, which is using IRunnable structure:



using Sage.SalesLogix.NetExtensions;

using Sage.SalesLogix.NetExtensions.Licensing;

using Sage.SalesLogix.NetExtensions.SalesLogix;

[ComVisible(true)]

public class SlxWrapper : MarshalByRefObject, IRunnable

{

    private ISlxApplication _slx;

    public void Initialize (ISlxApplication slxApplication, ILicenseKeyManager licenseKeyManager)

    {

      _slx = slxApplication;

    }

    public object Run (object[] args)

    {

        //process your arguments and fire of any other things you want to happen directly from slx lan client

    }

//here is amethod stub. This can be accessed from the returned object in your calling vb script

    public void SomeMetod()

    {

         //display a messgae box or somethig here

    }

//This will return a string from the .net extension to your calling code

    public string returnStringMetod()

    {

        return "some string value";

    }

}


I am missing a little piece of code, which will inherit SLX form for my .Net project.


I don`t clearly understand the logic, should i firstly Get this form (form.HWND) from SLX, then use this variable in my .Net project?

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 14 11:30 AM

To use the library you just can grab the source, update the references and .NET version, then recompile. Otherwise, you could just add the embed logic yourself (copying the relevant code from the library source).


Basically, to embed the form, you need to pass to the extension the HWND of the panel or form where you want to embed the .NET form, then use the SetParent Win32 API to change the parent of the .NET form to the HWND passed from SLX.


See here for SetParent https://github.com/CustomerFX/NetExtensionsHelper/blob/master/FX.SalesLogix.NetExtensionsHelper/SalesLogixControl.cs#L133 and then here for the code to resize the embedded .NET form to fill the parent area https://github.com/CustomerFX/NetExtensionsHelper/blob/master/FX.SalesLogix.NetExtensionsHelper/SalesLogixControl.cs#L165

[Reply][Quote]
Alex
Posts: 11
 
Re: SLX 8.0 .NET extension form inside the Saleslogix form using IRunnableYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Jul 14 4:04 AM

Thank You a lot!

[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 9:44:52 AM