Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, May 2, 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: Object required: 'Application.Managed.Run(...)'
Dan Brentley
Posts: 2
 
Object required: 'Application.Managed.Run(...)'Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Aug 12 7:55 AM
fiogf49gjkf0d

I've got a very basic .NET extension project (obviously the full project will be much bigger) but I'm having trouble getting it to work.  I'm using SalesLogix v7.5.2, and have created a simple .NET 3.5 class library:


using Sage.SalesLogix.NetExtensions;
using System.Windows.Forms;

 


namespace SLxTest
{
    public class Class1 : BaseRunnable
    {
        public override object Run(object[] args)
        {
            MessageBox.Show("Hello World");
            return "Hello";
        }
    }
}


And the calling code in SalesLogix is on the OnCreate event handler:


Sub AXFormCreate(Sender)
    Dim ext
    Dim id

 


    ext = Application.Managed.Create("SLxTest", "SLxTest.Class1")
    Set id = Application.Managed.Run(ext)
End Sub


On the 'Set id...' line I get the 'Object required: 'Application.Manager.Run(...)'' error message from VBScript.  I've looked around and checked the 5 .dll files (listed in 'RegisterSLXNetExtentions.bat' file, which also appears to execute correctly).  Strangely enough, when stepping through at breakpoint in VBScript, the 'ext' variable is correctly populated with some GUID looking value.  The .NET extension is also released to everyone, so I don't think it's a release problem.


Any help would be greatly appreciated...


Dan Brentley


 

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Object required: 'Application.Managed.Run(...)'Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 21 Aug 12 3:21 PM
fiogf49gjkf0d

Since you're not returning an object back from the extension, no need to use "Set". Remove that and all else looks fine to me.

[Reply][Quote]
Dan Brentley
Posts: 2
 
Re: Object required: 'Application.Managed.Run(...)'Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 22 Aug 12 2:18 AM
fiogf49gjkf0d

Hi Ryan,


Thanks for the reply; I tried that and then although I didn't get an error message, the message box (from the .NET code) didn't appear and the id variable wasn't populated (still 'Empty').  I've realised though that all the examples I've seen require at least one additional argument (on top of the 'ext' variable) to be passed to the Application.Managed.Run() method.  So the code now executes correctly once the VBScript is changed to:


Sub AXFormCreate(Sender)
    Dim ext
    Dim id

 


    ext = Application.Managed.Create("SLxTest", "SLxTest.Class1")
    id = Application.Managed.Run(ext, "")
End Sub


Even if I'd noticed that before, I'd probably have still then got confused by the resultant error message from not removing the 'Set' command, so thanks for the heads up!


Dan Brentley

[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Object required: 'Application.Managed.Run(...)'Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 23 Aug 12 12:08 AM
fiogf49gjkf0d

Ah, yes. Didn't notice that in your original code. You do need the second parameter. Blank string or Empty works fine.

[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): 5/2/2024 1:01:19 AM