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

Refresh the primary tab in service cloud console



I am also having same problem.

i am trying to refresh my primary tab and close the subtab.

below is the code which i am trying to do.

could you please assist me on this, if you have any code samples please share with me.


How can we get the primary tab id.


function RefreshPrimaryTabByName() {

var primaryTabName = "{!Case.Contact.Name}";

sforce.console.refreshPrimaryTabByName(primaryTabN​ame, true, refreshSuccess,closeCurrTab());


var refreshSuccess = function refreshSuccess(result) {

if (result.success == true) {

//alert('Primary tab refreshed successfully');

} else {

//alert('Primary tab did not refresh');



function closeCurrTab() {



var closeCurrTabById = function closeCurrTabById(result) {




Thank you,




Are you have any solution yet?


I can close subtab but my primaytab is not refreshing.


<apex:page standardController="Contact" extensions="PlaceAnOrderCls" sidebar="false" showHeader="false" >
<BODY onLoad="DoPage();"/> 
<flow:interview name="Place_an_Order" interview="{!newOrder}"/>
<apex:includeScript value="/support/console/26.0/integration.js"/>

<script type="text/javascript">
    function DoPage() {
    var theEnd = '{!TheEnd}';
    if(theEnd != ''){
    var getPrimary= function getPrimary(result) {
        sforce.console.refreshPrimaryTabById(result.Id, true, refreshSuccess);
     var refreshSuccess = function refreshSuccess(result) {
            if (result.success == true) {
                alert('Primary tab refreshed successfully');
            } else {
                alert('Primary did not refresh');

    var SubNext = function SubNext(result) {
       var tabId =;

 let me know if you have any suggestion.




I am facing the same issue. as per my understanding my subtab is a vf page and primary tab is a standard page. Due to the fact that my vf and standard page are on different domains and salesforce doesnt allow to access the standard page to be refreshed from VF page.alternative for this would be to override the standard page view with VF and then try to refresh the primary tab. this should solve the issue.