Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Wednesday, February 19, 2025 
 
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: How to return complex type from .NET Extension Form -- HELP
Veronka Capone
Posts: 113
 
How to return complex type from .NET Extension Form -- HELPYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Jul 09 2:12 PM
I created a class wich calls a form in C#. When the form closes I want to return to SLX an object.

SLX fails with the error: "Object required: 'Application.Managed.Run(...)'" at

set Result = Application.Managed.Run(ext, args)

If the class returns a simple type it works fine.

-------------------------------- C# Code --------------------------------

class SLXORDER // this is what I want to return to SLX
{
public string RA_ID;
public string NS_ID;
public string JOB_ID;
public string LoanerNS_ID;
public string LoanerRA_ID;

}

class SLX : Sage.SalesLogix.NetExtensions.IRunnable
{
private Sage.SalesLogix.NetExtensions.SalesLogix.ISlxApplication _SLXApplication;

public void Initialize(Sage.SalesLogix.NetExtensions.SalesLogix.ISlxApplication SLXApp, Sage.SalesLogix.NetExtensions.Licensing.ILicenseKeyManager LicenseKeyManager)
{
_SLXApplication = SLXApp;
}

public object Run(object[] Args)
{
frmPostRMA RMAForm = new frmPostRMA();
RMAForm.RMA_Type = Args[0].ToString();
....
RMAForm.ALLOWED_SHOT_COUNT = Args[9].ToString();

RMAForm.ShowDialog();

SLXORDER objOrder = new SLXORDER();
objOrder.RA_ID = "3333";
objOrder.NS_ID = "2222";
objOrder.JOB_ID = "11111";
objOrder.LoanerNS_ID = "44444";
objOrder.LoanerRA_ID = "55555";

//return "Success" -- returns value to SLX correctly
return objOrder; -- fails object required

}

----------------------------------------------SLX Code --------------------------------------
Dim ext
Dim args(9)

ext = Application.Managed.Create("Pmt_Svc_PostRMA", "Pmt_Svc_PostRMA.SLX")
args(0) = "Repair" 'RMA_Type
...
args(9) = txtAllowedShotCount.Text 'ALLOWED_SHOT_COUNT

' run it (and pass any arguments)
dim Result
' Result = Application.Managed.Run(ext, args) //returns string OK
set Result = Application.Managed.Run(ext, args)

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

[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: How to return complex type from .NET Extension Form -- HELPYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 09 1:16 AM
I believe you need to make your .Net component COM visible to be able to achieve this.
[Reply][Quote]
Veronka Capone
Posts: 113
 
Re: How to return complex type from .NET Extension Form -- HELPYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 09 8:49 AM
Hi Raul,

I tried folowing -- still same problem.

1) COMVisible with and without Register for COM Interop
2) Inherit SLX class from MarshalByRefObject
[Reply][Quote]
Raul A. Chavez
Posts: 1300
Top 10 forum poster: 1300 posts
 
Re: How to return complex type from .NET Extension Form -- HELPYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jul 09 9:12 AM
When you created your Class for COM, are you able to instantiate it from VB Script just by using "CreateObject"?
That would tell you if the Class is properly setup for COM.


Now, as far as returning it over to SLX, I am not sure if you need to do any custom Marshalling.
I have not tried to do what you are doing, but just wanted to point out that if your object wasn't COM Visible it had no chance of running on VB Script.

[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 © 2025 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): 2/19/2025 4:36:35 PM