-
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
When is the Right Time to Migrate to Salesforce Lightning Experience?
Oh! You are here, which means you are intrigued and excited about Salesforce Lightning experience. Let’s start with a general question that’s on everyone’s mind:…
Digitization - The Way Forward For Nonprofits | Salesforce Guide
Digitization is booming in every industry, big or small, after the COVID-19 hit. As companies and organizations are working remotely, this entails signing off the…
Top 10 Highlights of Dreamforce 2019
Hi, all Salesforce lovers! I know that every one of you would have wanted to be part of the Dreamforce ’19, the event of all…
Popular Salesforce Videos
Salesforce Staff Has Option to Keep Working From Home
Dan Bognar, head of the strategy for Asia at Salesforce.com Inc., discusses how the coronavirus outbreak is affecting the San Francisco-based software maker’s operations and…
Build Lightning Components with Salesforce DX
Learn how to get started with building Lightning Components, the Salesforce DX way. We'll leverage Base Components, Lightning Data Service, Salesforce CLI, Scratch Orgs, Salesforce…
Introduction to Quip for Customer 360 | Salesforce
In Quip for Customer 360 Admin Foundations, you’ll be introduced to Quip for Customer 360 from the admin perspective. You will gain an understanding of…