-
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 Service Cloud in 2024?
Salesforce Service Cloud is one of the platforms in the Salesforce ecosystem designed to optimize customer service and support processes. Service Cloud offers a variety…
CTI Integration With Salesforce: Streamlining Your Business for Maximum Efficiency
In today's fast-paced business world, it can be difficult to keep up with the demands of customers while still maintaining a high level of productivity.…
Why ISVs Must Strive Harder To Be On AppExchange?
Are you on Salesforce AppExchange? How many apps do you have on Salesforce AppExchange? If you are an ISV then you must be pretty aware…
Popular Salesforce Videos
Salesforce Field Service Implementation
The possibilities for building a custom field service implementation are nearly endless when considering all the offerings in Salesforce Field Service. This 8-step guide provides…
Introduction to Salesforce Shield Platform Encryption | Salesforce Tutorial
Introduction to Salesforce Shield Platform Encryption 0:00 Introduction 1:00 Shield Platform Encryption 2:35 Need for Shield Platform Encryption 3:18 Classic Encryption Vs Shield Platform Encryption…
Can Non-IT People Make their Career In Salesforce?
This video focuses on if non-IT people can make a career in Salesforce. Salesforce is a customer relationship management (CRM) platform that offers various roles…