+ Start a Discussion
SivarajanSivarajan 

Redirect from Visualforce to Service console

I have a quick Action button which is overridden with vf page on Case feed. Once I fill all the information and click Submit, it gets redirected to standard case feed record page instead of staying on Service console.

I call the following javascript method in action function:
oncomplete="Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {refresh: true }});"

I also tried the following but it does not work.
oncomplete="Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload :{refresh: "true" objectRelatedLists: {}}});"

I want to stay on Service console Once i complete the action. Any help much appreciated.
Best Answer chosen by Sivarajan
SivarajanSivarajan
I able to figure it out by using the following javascript as mentioned in the service console guide :
oncomplete="Sfdc.canvas.publisher.publish( {name : 'publisher.refresh', payload : {feed: true, objectRelatedLists: {}}});"/>
 

All Answers

Martijn SchwarzerMartijn Schwarzer
Hi Sivarajan,

I've solved it the following way:

In my controller I have an attribute that gives me the Salesforce Base URL:
 
public String currOrgEndPoint{get{
    return URL.getSalesforceBaseUrl().toExternalForm();
    } private set;}

In my page I have a javascript function that redirects to the console:
 
var currOrgUrl = '{!currOrgEndPoint}';
window.open(currOrgUrl+"/console", "_parent");

Hope this helps!

Best regards,
Martijn Schwärzer
SivarajanSivarajan
Hi Martijn,

Thanks for your reply. I tried that option already but the only problem here is that it takes visualforce instance instead of Salesforce instance.
Is there any other easy way get Salesforce instance instead of applying regrex on the visualforce instance.
I would like to redirect to https://xxx.Salesforce.com/console.
 
SivarajanSivarajan

I want to refresh only the case feed updates not the entrie page. 
SivarajanSivarajan
I able to figure it out by using the following javascript as mentioned in the service console guide :
oncomplete="Sfdc.canvas.publisher.publish( {name : 'publisher.refresh', payload : {feed: true, objectRelatedLists: {}}});"/>
 
This was selected as the best answer