06-13-2012 04:47 AM - edited 06-13-2012 05:23 AM
I'm having a pretty frustrating problem with the refreshview function. Namely it doesn't seem to do anything.
I'm using it like
string view = this.application.CurrentViewName;
to no effect.
works. Also the string DOES get filled with the proper view name (in this case Act.UI.IOpportunityDetailView).
Am I missing something really obvious here?
EDIT: Act Premium 2012, Windows 7(32bit)
06-13-2012 06:39 AM
Is there some UI element that you can tell isn't being refreshed? I plugged in the code you used and set it fire when a custom menu item was clicked and the current view refreshes for me. Alternatively, this also worked for me and accomplishes the same thing:
Act.UI.IView myView = ActApp.CurrentView;
06-13-2012 07:05 AM
it's IOpportunityDetailView that i'm trying to refresh. Basically the plugin updates some custom fields in the products/services tabs. Doing refreshloadedviews at the end refreshes the whole thing and shows the changes. But neither my or your way of doing refreshview doesn't seem to.
06-13-2012 07:34 AM
When you call the update method for the opportunity on which you changing field values for, it shoudl refresh the view and the changes should be visible at that time without needing to refresh the view at all.
06-13-2012 09:56 AM
so before it wasn't doign an opportunity.update() at any point, since all that was needed was opportunityproduct.update(). I've added opportunity.update() to the code but it doesn't seem to do anything either. I've just noticed that hitting f5on the opportunity view doesn't seem to visibly refresh either. I wonder if one of the plugins i'm running is interfering with it, I'll disable them and try it tomorrow.
06-13-2012 11:07 AM
If hitting F5 isn't refresing your view I'd suspect there some problem other than your plug-in. I haven't seen that happen before though, I'd debug through and make sure the events aren't firing, there may not be any visual indication that it's occurring, because I've not seen that happen before.
06-14-2012 02:15 AM
So I've figured out that it refreshes if i pass OpportunityView as the name instead of OpportunityDetailView. The only problem now is that in 90% of the cases it works fine but in about 10% is loads a different opportunity to the one that was open previously.