-
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 to Reduce Your Salesforce Licensing Cost Smartly
Salesforce is the world’s no. 1 CRM with over 150,000 companies across various industries as its customers. Right from small businesses to FORTUNE 500 companies,…
The Journey Of Salesforce - Walking Down The Memory Lane
Salesforce is the most popular CRM, connecting businesses and customers in the digital age. Salesforce, which was founded in 1999, enables businesses of all sizes…
Learn All About Salesforce Managed Services vs In-house Team
The day-to-day operations of modern businesses depend on technology and cloud-based tools. With ever-changing IT needs and business configuration tools becoming more important, one small…
Popular Salesforce Videos
Running a New Report in Salesforce
After logging into Salesforce, Go to the reporting section by clicking on the Reports tab at the top of the page, Click on the New…
Salesforce Platform Developer 1 Certification Training | Salesforce Training Video
This Salesforce Training Video will give an overview of Salesforce Certification Training by explaining what is Salesforce, Why we need Salesforce, Salesforce Career opportunities and…
Create Walkthroughs in Salesforce Lightning Experience
This video shows you how to create a walkthrough with the In-App Guidance Builder. Then you can create hands-on guided training experiences for in-app onboarding,…