-
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

Main Features of Salesforce Summer’22 Release to Make Your Customers Happier
Even though the sandbox preview with early access to new features and test configurations of the Summer’22 release was held on May 6-7, the production…

Best Practices for Salesforce Integration: Streamlining and Optimizing Your Workflow
Salesforce integration plays a crucial role in connecting your org with other systems, streamlining workflows, and enabling data-driven decision-making. To ensure successful integration, it’s essential…

What are Schedule-Triggered Flows? | The Ultimate Guide
What are Schedule-triggered Flows? Schedule-triggered flows start up at predetermined intervals and let you automate Salesforce activities. Teams can greatly benefit from this kind of…
Popular Salesforce Videos
How to import data from Sage ERP to Salesforce - Part 1
Greytrix offers GUMU™ integration for Salesforce with Sage ERP systems - a best-of-breed solution for organizations to enhance their customer interaction. With Salesforce and Sage…
How to Set Up Web Chat in Salesforce Service Cloud SFDC - Learn Salesforce Series with Algoworks
In this video, you will get to know what the webchat feature in Salesforce Service Cloud is all about. Learn how to - 1. Introduction…
How Trailhead Military can Help You to Get a Job? | The Shrey Sharma Show | Salesforce
Shrey is a Chief Executive Officer at Cyntexa, a SILVER Salesforce Consulting Partner in the USA, UK, UAE, Australia, Singapore & India, having a vibrant…