-
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 Make Your Salesforce Reports Run Faster
In this article, we are going to share some known tips and tricks which can make your Salesforce reports run faster. Most reports load in a matter…
Salesforce Product : Financial Services Cloud
The world's #1 CRM Salesforce has something great for financial services which is Financial Services Cloud. Financial Services Cloud enables the feature to connect entire organization…
How do I Transform my Business with Salesforce AI?
Financial Transactions are an integrated part of our lives. We depend on the capacity to purchase anything we desire at any place we like with…
Popular Salesforce Videos
GS DevOps Mate: Your Free Flexible Toolkit for Faster and Smoother Salesforce Deployments
Are you considering automated Salesforce deployments based on repos? Or are you struggling with setting up CI/CD utilizing SFDX on the CI/CD platform of your…
Create an Email Alert Workflow Rule | Workflow Rules in Salesforce | Salesforce Automations
Configuring Workflow Rule Email Alerts or Notifications Follow. Workflow Rules are automatic processes that trigger an action when a certain event occurs, such as updating…
Salesforce Data Management - Data Loader - Insert, Update, Upsert, Export, Delete
Use the Data Loader wizards to add, modify, or delete records. The upsert wizard combines inserting and updating a record. If a record in your…