• Anusha Ravipati
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
<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"