function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prateek gandhi 3prateek gandhi 3 

Issue while refreshing current tab in salesforce console

<apex:page standardController="Case">
<A HREF="#" onClick="testTabRefresh();return false">
    Click here to close this tab</A>
    {!now()}
<apex:includeScript value="/support/console/22.0/integration.js"/>
<script type="text/javascript">
    function testTabRefresh() {
        //First find the ID of the current tab to refresh it
        sforce.console.getEnclosingTabId(refreshSubtab);
    }
    var refreshSubtab = function refreshSubtab(result){
        var subTabId = result.id;
        console.log(result);
        sforce.console.refreshSubtabById(subTabId, true, refreshSuccess );          
    }

    var refreshSuccess = function refreshSuccess(result) {
        console.log(result);
        //Report whether refreshing the subtab was successful
        if (result.success == true) {
            console.log('Subtab refreshed successfully');
        } else {
            console.log('Subtab did not refresh');
        }
    };
</script>

I'm trying to refresh case page in service console using javascript but its not working, can anyone tell me the issue with the following code? Also can anyone explain following usage condition mentioned in console API documents for tab refresh methods

"This method can't refresh subtabs with URLs to external pages or Visualforce pages"

Pavan Kumar KajaPavan Kumar Kaja
HI Prateek,

The above code is working.

Let me know what you want do exactly.
Anusha RavipatiAnusha Ravipati
We can use window.top.location='/console';  to refresh subtab/console from vf page. Hope this helps any one who are strugling to refresh tabs/console fron Vf pages.