Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 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: Something Nice
Jeff Weight
Posts: 219
 
Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 07 4:04 PM
A lot of the users in my company have been complaining about how slow the Notes/History tab has been on the Opportunity main view, and I finally looked into it. I didn't have any customizations for it, and we are on Version 7.0. I watched what was happening in the profiler, and it was taking minutes to load sometimes, because it was doing a request with a blank ID. I don't know why it was doing that, but it seemed stupid. I made a small change to the Notes History Common VBScript on line 478:

I removed the following lines:
grdHistory.SQL.Text = strGridSQL
grdHistory.Active = True

And added the following lines:
Dim hCon, hRS, strCurrentID
Set hCon = Application.GetNewConnection
strCurrentID = Application.MainViews.ActiveView.CurrentID
If strCurrentID = "" Then strCurrentID = "XXXXXXXXXX"
strGridSQL = Replace(strGridSQL, ":BindID", "'" & strCurrentID & "'")
Set hRS = hCon.Execute(strGridSQL)
grdHistory.Recordset = hRS.Clone
Set hRS = Nothing

And it works wonderfully! The records load very very quickly now, and for any Notes/History tab in SalesLogix. I also added an index to help, of course. The index is just on the OpportunityID with no extras. The only problem I have come across is if the Notes/History tab is active on a screen that is behind another screen - if the user does a System Refresh, or Control+F5, then it won't load the records until the user presses F5 or clicks on another tab and then clicks back to the Notes/History tab. This happens because the ActiveView.CurrentID is blank on any non-active windows (of course). I tried other ways to solve this, but I can't grab an ID unless it is active. I figured that this was obscure enough that it won't be a problem for our company.

I feel unusually excited to have conquered this thing that's been plaquing my company for a while. So I thought I'd share - even if no one else cares. Maybe someone out there will find it useful.
[Reply][Quote]
Ryan Farley
Posts: 2265
slxdeveloper.com Site Administrator
Top 10 forum poster: 2265 posts
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Nov 07 4:13 PM
Thanks a bunch for this Jeff. I will give this code a try in my own SLX system - which I avoid even going to the history tab in because it takes so long to load!

-Ryan
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Nov 07 2:24 PM
Cool! I avoid this tab as well because of the speed. Going to try this out.

Thanks!
John G.
[Reply][Quote]
John Gundrum
Posts: 632
Top 10 forum poster: 632 posts
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Nov 07 2:44 PM
Cool! I avoid this tab as well because of the speed. Going to try this out.

Thanks!
John G.
[Reply][Quote]
Rick Smith
Posts: 96
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 07 8:17 AM
Hi Guys - sorry I missed you at the Summit.
We had similar slowness on the Notes/History tab within Opportunities. Examining our HISTORY table, I found that there was no index on the OPPORTUNITYID field (whereas ACCOUNTID, CONTACTID, and ACTIVITIYID have indices). Figured it was worth a try to add an index on OPPORTUNITYID, and voila, the response speed of the tab UI increased tremendously. Perhaps the vb suggested at the start of this thread will provide an additional boost. (v 6.2)
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 07 10:17 AM
Yeah, as I mentioned, I did add the index for the OpportunityID field on the History table first - I was hoping to avoid code changes (I didn't know how extensive the code change would be). I think the index did help in boosting the speed, but not enough. When I ran the query that showed up in the query analyzer, I found that SalesLogix always ran a query on the history table joined with the picklist table, and the condition was to look for a blank OpportunityID. That query returned over 900,000 records and took a few minutes to run. This was partially due to the fact that datagrids hooked directly to the database run twice. I guess the index could only do so much. Part of the script change I implemented was to prevent passing in a blank OpportunityID.
[Reply][Quote]
Ted Sturr
Posts: 78
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 07 12:46 PM
You wrote:
". . . The only problem I have come across is if the Notes/History tab is active on a screen that is behind another screen - if the user does a System Refresh, or Control+F5, then it won't load the records until the user presses F5 or clicks on another tab and then clicks back to the Notes/History tab. This happens because the ActiveView.CurrentID is blank on any non-active windows (of course). "

Just a thought - I haven't tried it yet so maybe you already have. Couldn't you bind a hidden field on each Notes History tab called txtCurrentID and have that bound to the forms ID field? So then you could make this change to your if then statement:

If strCurrentID = "" Then strCurrentID = txtCurrentID.Text & ""

Again, I haven't tried this and it does mean you would have to touch each of the note history forms. I am loading it in as a test right now so will post if I get this change to work.

Ted
[Reply][Quote]
Jeff Weight
Posts: 219
 
Re: Something NiceYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Nov 07 12:58 PM


Yep, I tried that - that field came up blank before it came up with an ID, so it always ran the query with the blank ID as well. My wife actually works as a customer service rep at my company, so she uses SalesLogix. Whenever there is a problem, I'll hear about it on the way home - so, needless to say, some fixes receive attention more quickly than they normally would Anyway, I was working on this issue, and I thought about what you mentioned. I went and put it together, switched from Architect to SalesLogix to test, and my wife walks up behind me because we were getting ready to go to lunch. I told her that I made a change and the tab should run MUCH more quickly, and then I ran the test with her standing there. Sure enough, it froze up for a few minutes again, and she said, "Sure, honey, that is WAY faster." That's the last time she watches a test...

I think I tried CurrentOpportunityID as well just for that instance in testing, and for some reason it died too. Maybe I missed something - I would love to see this code work perfectly
[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/26/2024 12:53:03 AM