-
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 is Salesforce Community Cloud?
Originally named ‘Salesforce Customer and Partner Portals’, Community Cloud is among the most popular cloud options from Salesforce. As with the rest of the platform,…
How Can Salesforce CRM Boost its Sales Revenue?
Salesforce is a CRM that puts sales at the center of its operation. Salesforce has the capacity to do it just right, from acquiring precise…
Data Export in Salesforce - A Brief Guide
Exporting data from Salesforce can be done with the help of Data Export methods, it can be done either in a manual way or in…
Popular Salesforce Videos
Heroku | Salesforce Development Course
Knowledge of Heroku is also required to crack the Salesforce PD 1 Certification Examination. Let’s understand what Heroku is and what are its uses, in…
How to Become Salesforce Developer | Salesforce For Beginners
In this how-to become Salesforce developer video, you will be learning what is Salesforce, the fundamentals of Salesforce, how to become a Salesforce developer, how…
How to: Work at Salesforce — Interview Process | Salesforce Software Engineer
Watch this video to know about the Salesforce Interview Process and how you can start working for this dream company. We hope this video answers…