-
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 are the Development Tools in Salesforce?
As the world's largest CRM, Salesforce offers many helpful tools. These Salesforce development tools have been helping and reshaping enterprises of all kinds and categories…
Custom Lookup Field in Visualforce Page | Salesforce Developer Guide
We all know about the Standard Lookup functionality, it's provided by Salesforce. The standard Lookup field gives a dialog box that supports a little quantity…
Health Cloud Console Unit in Salesforce - Get Started
In this blog, we will discuss about Health Cloud, its specific terminology, and its architecture. Let’s move to Salesforce Health Cloud Core Capabilities which are:…
Popular Salesforce Videos
Introduction to Salesforce Aura Components Development
In this video, Salesforce Casts gives an introduction to Aura Components Development. If you have any doubts or concern do reach out to us in…
Salesforce Data Loader Tutorial
The Salesforce Data Loader is an easy to use graphical tool that helps you to get your data into Salesforce objects. The Data Loader can…
Being a Sr. Salesforce Consultant | SFDC Consultant Podcast
What it is like being a Sr. Salesforce Developer at a consulting firm. What a day in Sr. Salesforce Consultant's life looks like. Struggles of…