-
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
Email Service-Inserting Data in Salesforce using Email Attachment
Force.com provides us powerful and secure functionality for sending and receiving emails. We can execute our apex logic whenever we receive an email. By using…
Transform businesses with the power of Artificial Intelligence leveraged through Salesforce Einstein
Artificial Intelligence is powering next-generation customer experiences with smart predictions, intelligent recommendations, timely automation and much more. Gartner predicts that by 2020, a staggering 85% of…
New Commerce Solutions on Salesforce AppExchange
In case you're a Commerce Cloud client, you can now effectively discover, attempt, and purchase applications to make a total trade arrangement with applications for…
Popular Salesforce Videos
Common Salesforce Project Risks and How to Mitigate Them
Salesforce is easy to use, but don’t let its user-friendly interface fool you. Deploying Salesforce projects takes planning to be effective. Otherwise, you expose your…
Salesforce — How To Improve Customer Service for Small Businesses
How can a small business improve its customer service? More than ever before, supporting customers is key to a small business's survival — so give…
How to Become a Salesforce Admin | 6-step Guide
Salesforce administrators are the backbone of any company that uses Salesforce. They are responsible for maintaining the Salesforce platform to ensure it meets the needs…