Community
Showing results for 
Search instead for 
Do you mean 
Reply

RefreshView issue

Copper Contributor
Posts: 32
Country: United_Kingdom

RefreshView issue

[ Edited ]

Hi everyone.
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;
this.application.RefreshView(view);

to no effect.

However,

this.application.RefreshLoadedViews();

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)

Employee
Posts: 1,163
Country: USA

Re: RefreshView issue

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;
myView.RefreshView();

 

 

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: RefreshView issue

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.

Employee
Posts: 1,163
Country: USA

Re: RefreshView issue

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.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: RefreshView issue

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.

 

Employee
Posts: 1,163
Country: USA

Re: RefreshView issue

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. 

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: RefreshView issue

cheers. I don't think I can debug through since I'm using visual studio express and it's a dll. I'll let you know when I figure something out though.
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: RefreshView issue

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.