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!
|
|
Capturing Events Fired through .NET User Control
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 |
|
|
|
Re: Capturing Events Fired through .NET User Control
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 |
|
|
|
Re: Capturing Events Fired through .NET User Control
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 |
|
|
|
Re: Capturing Events Fired through .NET User Control
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. |
|
|
| |
|
Re: Capturing Events Fired through .NET User Control
Posted: 03 Apr 07 10:29 AM
|
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? |
|
|
| |
|
Re: Capturing Events Fired through .NET User Control
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
|
|
|
| |
|