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!
|
|
Opportunity Chart
Posted: 23 Jul 07 10:06 AM
|
for SalesLogix 7.0.1
I am trying to create a chart in Opportunities. The chart already exists in the sales dashboard and works fine. It is a custom chart showing opportunity trends. The opportunity trend data comes from a custom table. This custom table is defined in the DB Manager and is listed under the Opportunity table.
What we wanted to do was create the same exact dashboard chart as a tab in Opportunity Detail. My first attempt was done by creating an new Opportunity form. I then copied the script from the Sales Dashboard plugin and pasted it into the script tab of my new Opportunity form. I did the same thing with the chart. I copied the chart from the Sales Dashboard plugin and pasted it into my new Opportunity form plugin. I saved the new form and the tab appears under 'More tab..." but when you click on this new tab the chart is completely blank.
I haven't modified the script at all. I first wanted to see the chart working in the Opportunity screen exactly as it is in the Sales Dashboard. Later, the recordset will be restricted to just the one opportunity. For now, the chart should display exactly as the one that currently works in the Sales Dashboard.
I tried recreating the chart as well. I deleted the chart I copied and added a new chart and it still does not work.
Is the chart control suppose to work outside the Sales Dashboard? What might I be doing wrong?
Thanks, John G. |
|
|
|
Re: Opportunity Chart
Posted: 25 Jul 07 5:57 AM
|
In the code that works fine in the Sales Dashboard there is this Sub called AXFormOpen. This Sub loads the chart data
Sub AXFormOpen(Sender) LoadChart End Sub
After putting a MsgBox("AXFormOpen") in this Sub I figured out that when tab opens this method is not automatically being executed. To test further I added a 'Refresh' button with this code.
Sub btnRefreshClick(Sender) LoadChart End Sub Clicking the button loaded the chart data and all looks fine.
How would you automatically load the chart data when the tab is selected or in the middle pane?
Thanks, John G. |
|
|
|
Re: Opportunity Chart
Posted: 25 Jul 07 8:03 AM
|
I had this recently, and I found that the AXFormOpen event never fired. In my case it was that I had not associated the Open Event with the Sub in the Form's Properties/Events tab. D'oh!
If this isn't it, and if On Open doesn't fire, you could try adding a hidden control on your form with the OPPORTUNITYID in it, and put your code in the Sub bound to the On Change Event instead? |
|
|
|
Re: Opportunity Chart
Posted: 25 Jul 07 9:01 AM
|
Yep... I tried adding that and the chart is still not refreshing. I added the Sub to the OnRefresh event and when I press F5 it does update, but I need the chart to update when you navigate from opportunity to opportunity.
Frustrating...
|
|
|
| |
|
Re: Opportunity Chart
Posted: 25 Jul 07 9:14 AM
|
AXFORMCHANGE guys, not the FormOpen (before the data gets there, and this is what you do on a Managed View, not a DataBound Data Form/Detail View).
You don't have an OpportunityID to work on until SUB AXFORMCHANGE(Sender)
Been like that for 10 years.
From a design standpoint....do you really really really want this to fire automatically? Now that YOU want it to fire, ask all of your users. and then have them sit back on a train or at a Panera Bread or during a customer meeting and watch the dashboard slow things down as they click between opportunities.
I'd put a BUTTON on the form "LOAD 'ER UP" and let them click it when they want to see it....or have a button on the Opportunity Screen to "LAUNCH OPPORTUNITY CHART" when they want to invoke it.....give the users a little control in their lives.
some of us are still ticked off that ALL of the tab forms and ALL of the JOINDATA joins are/were executed in the background every time you change Account's, etc. Back in the day of 256Mb of RAM and 600 Mhz processors this was killer. Even today with DuoCore and 3GB RAM on a laptop I know of many tabs that are just crawlers.....SALES STATISTICS, Invoice Data, etc.
And yes, SLX Development is fun.
RJ Samp
So careful, you might get what you ask for!
|
|
|
|
Re: Opportunity Chart
Posted: 25 Jul 07 10:46 AM
|
RJ,
I created a new Opportunity form called frmOpportunityTrends and the plug-in is name Opportunity Trends. This form is a member of the Opportunity Family and appears in More Tabs... of an opportunity.
If I click the Opportunity Trends tab I need it to display the trends for the opportunity. Not just display a blank chart. If the tab is in the middle pane, I need the chart to update itself if you are navigating through opportunities.
Sales managers and higher are using this to see at an instant (a relative term I know) the trend for the opportunity they are viewing. They do not want to have to remember to click a button or press F5 to populate a chart.
This is the challenge I am trying to resolve. The frmOpportunityTrends form does not have an AXFORMCHANGE event.
|
|
|
|
Re: Opportunity Chart
Posted: 25 Jul 07 11:15 AM
|
Mine does.....you need to double click on the Forms EVents tab in the white space corresponding to the event you want to create a subroutine for...... There are Numerous events, but the script isn't created for ALL of them automatically. Double clicking on the Form itself will automatically create an entry point for AXFormOpen.
option explicit
Sub AXFormChange(Sender) CALL LOAD_EM_UP End Sub
This has been around since v6.
RJ Samp
|
|
|
|