-
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
How Can Small Businesses Grow Faster With Salesforce Essentials?
Running a small business is not everyone’s cup of tea, if you are a small business owner you are bound to face challenges. As small…
Salesforce Marketing Cloud Benefits in 2024
Contents Why choose the Salesforce Marketing Cloud? Key Benefits of Salesforce Marketing Cloud Personalization Multi-Channel Marketing Marketing Automation Data-Driven Insights Audience Segmentation Lead Management Scalability…
The All New Salesforce Service Cloud Summer'21 Top Features
On the world's first all-digital interaction platform, connect all of your outlets. Deliver industry-leading customer service management from the contact center to the field. The…
Popular Salesforce Videos
TrailheaDX 2020 Opening Film | Salesforce
Now more than ever, Trailblazers are using the Salesforce Platform from anywhere in the world to collaborate, innovate, make a change, and build a brighter…
Salesforce Lightning Development Tutorial - Hello World!
Salesforce Lightning Custom Component Development Tutorial for Beginners - Let us implement our first custom lightning component - Hello World! Video Resource: Lightning Evangelist
Custom Login Page Using Mulesoft | Salesforce Tutorial
In this video, you will learn how to create a custom login page using Mulesoft. Watch and learn. If you have any doubts do let…