Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, November 29, 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 Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Capturing Events Fired through .NET User Control
Chelsea McGowan
Posts: 7
 
Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 30 Mar 07 4:47 PM
fiogf49gjkf0d
I posted this in .NET Extensions - but realized that was for 7.0 - I am working with 6.26

Hi,

I am pretty new to SLX, and am trying to create a new opportunity/sales flow - I have created a .NET user control that fires events - Right now I am using a Timer to check the values inside my .NET object - and refreshing (every second) This seems like a lot of overhead.. Can I capture the events fired in my .NET user control?

Thanks for your help
- Chelsea
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Apr 07 11:34 PM
fiogf49gjkf0d
There are a few different ways to go about this, really depends on the specific sceanrio you're trying to do.

First of all, keep in mind that you can make the call to your .NET code blocking so that you can just follow up any processing after the .NET stuff has completed. Also, you are able to fully expose your .NET code so things are driven by the script in SLX and the events are passed into the .NET code for processing. Of course, as I said, there are several ways you can do this - depending on the scenario.

An easy way to approach this is to create a script in SLX to be the event handler. For this example, let's say you create a script to handle some event called "System:MyEventHandler". It would need basically just a Sub Main and what ever code you want to execute for the event. Then in your .NET code, you'll just invoke that script when you want the event to fire.

ie:

SalesLogix.ISlxApplication slx = new SalesLogix.SlxApplicationClass();
slx.BasicFunctions.DoInvoke("ActiveScript", "System:MyEventHandler");


Make sense?

So basically you'll create a script to be the handler for each event. You could consolidate it all into one script, just set a global before invoking it, checking the global in the handler script and then branching off to the sub/function for the specific event (based on the global that was set).

There are some ways to wire up the events in VBScript to have the events wired up normally. Look into HookEvents, also VBScript's built in GetRef could be used for this as well.

-Ryan
[Reply][Quote]
Chelsea McGowan
Posts: 7
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Apr 07 4:00 PM
fiogf49gjkf0d
Thank you so much - That worked Great!

I think I am missing one basic step - I am going to look around in the forum - and may answer my own question ..

So my .NET userControl now's fires the SLX event - The only issue I am having now is refreshing the datagrid. I also decided to set a label value = the selected quoteID and that value does not show up.

When I debug I see that the frm_SalesOrderProcess is populated with the form object (I can see the blQuoteID current caption) as is the QuoteID that I pass in from .NET.

In my SLX Script

dim frm_SalesOrderProcess
frm_SalesOrderProcess = Application.Forms("Opportunity:SaleOrderProcess")
frm_SalesOrderProcess.dgQuoteProducts.BindID = quoteID
frm_SalesOrderProcess.dgQuoteProducts.Refresh
frm_SalesOrderProcess.lblQuoteID.Caption = quoteID
frm_SalesOrderProcess.Refresh
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Apr 07 11:34 PM
fiogf49gjkf0d
OK. So not sure I follow. What exactly is the problem now? From what you say, it sounds like you're attempting to just refresh the grid from the .NET app? Looks like you're on the right track.
[Reply][Quote]
Chelsea McGowan
Posts: 7
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 07 7:35 AM
fiogf49gjkf0d
That is exactly what I am trying to do - And it is not refreshing.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 07 10:29 AM
Quote:
Originally posted by Chelsea McGowan

That is exactly what I am trying to do - And it is not refreshing.


OK, so let's narrow this down. The fact that you're not getting a runtime error means that you're properly getting a reference to the form, and the grid. Also, the fact that a runtime error doesn't happen when you call the grid's refresh method means that you do in fact have a refernce to the grid and caling it's refresh method (well, at least we know it is a reference to an object that exposes a "Refresh" method, from the name we conclude it is the grid object that you're after).

So, from that I'd guess that you are "refreshing the grid" sucessfully.

That just leaves us with that the grid's refresh isn't producing the results you're expecting. What are you expecting to see in the grid that isn't happening? I assume that you're writing some data to the table the grid is bound to and then wanting to refresh the grid to see the data? Right? Can you confirm that the data is in fact being written to the table? If you perform a F5 does the data show? If you perform a CTRL+F5 does the data show?
[Reply][Quote]
Chelsea McGowan
Posts: 7
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Apr 07 3:33 PM
fiogf49gjkf0d
It must have not really refreshed - As I did not touch that code today - and magically its refreshing )

Thanks again for your help!!
[Reply][Quote]
Jeff L
Posts: 65
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jul 08 7:14 PM
Ryan I am missing a big step.

I created a .Net assembly (v7). My first. This event will process an event that I need to pass back a value to SalesLogix.

From you post you mention doing the following.

SalesLogix.ISlxApplication slx = new SalesLogix.SlxApplicationClass();
slx.BasicFunctions.DoInvoke("ActiveScript", "System:MyEventHandler");


Where SalesLogix.ISlxApplication defined. I have added a refrence to Sage.SalesLogix.NetExtensions.Frame work to the project. I added 'using Sage.SalesLogix.NetExtensions' to the class module.

I also cannot seem to access DoInvoke.

What am I missing ?

Jeff
[Reply][Quote]
Jeff L
Posts: 65
 
Re: Capturing Events Fired through .NET User ControlYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 20 Jul 08 8:56 PM
Never Mind.

I found where is was off base.

[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/29/2024 10:37:27 AM