-
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
Salesforce CRM Helping Your SMB Run Like an Enterprise
Small and Medium Businesses (SMB’s) don’t have the financial resources to invest in technology like large enterprises do, yet they encounter all the same challenges…
Enable Skype for Salesforce | The Developer Guide
We all are very much familiar with Skype, here I am going to tell you about how skype can be used for Salesforce, coordinates Salesforce…
Top 8 Things to Consider While Selecting Salesforce CPQ Consulting Partner
Salesforce CRM has been a revelation when it comes to elevating the productivity of the company. Starting from managing the Sales Funnel to getting the…
Popular Salesforce Videos
Process Builder In Salesforce | Tutorial Video
Do you want to create a record for any object from a workflow? Do you want to call your Apex class from a workflow? Do…
How to Manage Your Data and Contacts in Salesforce Marketing Cloud
Learn how contacts are counted and how data is structured in Marketing Cloud. This video explores how Marketing Cloud receives data from many sources and…
Makes Migration Between Salesforce Org Easy Using BOFC Application
BOFC has empowered global organizations by simplifying one of the biggest challenges in Salesforce migration, i.e., metadata management. In the above one got to know…