This issue is specific to Lightning Environment. I have a custom Button on Opportunity Object.This custom Button has a VF page behind it.The VF page consists of only opening & closing tags with an Action being called from controller.The action only updates Owner field. This custom button works well.On click of button it updates the owner field but it takes time to show the updated owner value on the lightning detail page.I need to manually hard refresh page 2 to 3 times.Can i get a way that to show the updated value on lightning detail page at the 1st glance?
Code :
<apex:page standardController="Account" extensions="AccountOwner" action="{!doUpdate}">
</apex:page>
//Class
public with sharing class AccountOwner {
Account record;
public AccountOwner(ApexPages.StandardController stdController) {
record = (Account)stdController.getRecord();
}
public PageReference doUpdate() {
record.ownerId = UserInfo.getUserId();
update record;
return (new ApexPages.StandardController(record)).view();
}
}