-
Navigate to URL is not refreshing the page in Salesforce Lightning
I have a visualforce page in lightning which opens up on button click from the case detail page. The visualforce page will close the case upon save. I have an oncomplete method in visualforce page which navigates to the case detail page once database update is done. The case detail is not getting refreshed. How can i refresh the page?
Can anyone help me in this regard?
I tried using page reference without using on complete, even in there the page is not getting refreshed.
Visualforce page with on complete
function refreshpage() { alert("method invoked 1"); var caseId='{!record.Id}'; if (sforce.console.isInConsole()) { window.top.location = '{!JSENCODE($CurrentPage.parameters.parent_domain)}/console'; }if({!$User.UITheme == 'Theme4d'}){ alert('Lightning-->'+caseId); sforce.one.navigateToURL('/one/one.app#/sObject/'+caseId+'/view',true); } else { window.top.location = '/{!$CurrentPage.parameters.id}'; }
<apex:commandbutton value="Save" action="{!save}" rendered="{!displayItems}" oncomplete="refreshpage();"> </apex:commandbutton>
Controller with Page Reference
public PageReference save() { update record; PageReference pageRef = new PageReference('/' + record.Id); return pageRef; //return controller.view(); }
I have tried all the below possibilities nothing seems to be working.
//window.open(window.location.origin+'/one/one.app#/sObject/'+caseId+'/view','_parent');
//sforce.one.navigateToSObject(caseId);
//window.location.href='/one/one.app#/sObject/'+caseId+'/view';
// window.top.location = '/{!$CurrentPage.parameters.id}';
// $A.get('e.force:refreshView').fire();
//Sfdc.canvas.publisher.publish({ name : "publisher.refresh", payload : { feed:true }});
//Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed: true, objectFields: true, objectRelatedLists: {}}});
//window.reload(true);
//window.close();
//sforce.one.navigateToURL('/one/one.app#/sObject/'+caseId+'/view',true);
Log In to reply.
Popular Salesforce Blogs

Mobile Salesforce Solution That is Perfect For You
Let us just take a quick tour down memory lane of how we have used desktop computers for surfing a website built with Flash and…

5 Ways to Grow and Build Trust in Finance Business | Salesforce
We all know of the financial crisis in 2007. The one that sent shockwaves in the financial business, not only in the US but all…

Salesforce Interview Question – Part 2
1. What is an interface in apex? Ans. An interface is like an Apex class in which none of the methods has been implemented. It only…
Popular Salesforce Videos
Video calling in Salesforce using WebRTC
Enhance your contact center offering by integrating WebRTC video calling directly into Salesforce Service Cloud. This video will guide you in understanding how you can…
Easy Salesforce Lightning Experience Tricks for Admins
Learn how to enhance the screens for your end users by leveraging Related List - Quick Links, Report Charts and dynamic filters to show the…
Tableau CRM for Emergency Response Management | Salesforce
When disaster strikes, public and private health organizations, as well as government agencies, need to respond quickly and efficiently. Tableau CRM for Emergency Response Management…