-
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
What Makes the Salesforce Ecosystem a Game-Changer for Businesses?
Introduction: Why the Salesforce Ecosystem Matters Imagine having a single platform that connects your sales, marketing, customer support, and analytics teams seamlessly while adapting to…
Welkin's Customizable Path Brings your Salesforce Sales Path to a Completely New Level
We're extremely glad to introduce to you our new AppExchange product - Welkin's Customizable Path. Would you like to give your users better visibility of…
The Secret to Successful Email Marketing: Salesforce Marketing Cloud's Automation
Any marketing strategy still needs to include email marketing, and because of the development of marketing automation, it is now simpler than ever to design…
Popular Salesforce Videos
Learn Apex Triggers Part 1 in Salesforce Development
In this video, you will be learning about Apex Triggers in Salesforce Development: We will be discussing the following things in this video: 1. What…
Salesforce Lightning Tutorial | Build a Custom Lightning Home Page
This Salesforce Lightning Tutorial video by Edureka will help you understand what exactly is Salesforce lightning. It will also talk about some of the features…
Welcome to the New World of Data Collection | Salesforce | Summer Internship
Secure data collection built for your needs. With FormAssembly, your organization can streamline outdated processes and power important business initiatives. To enroll Contact us +91…