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
KrForceKrForce 

refresh primary tab after 5 secs of any adjacent tab close

Hi,

I want to refreshrefresh primary tab after 5 secs of any adjacent tab close. With will below clode immediate refresh works fine, my goal is to add a delay for 5 secs and then refresh. Any suggestions?
 
sforce.console.addEventListener(sforce.console.ConsoleEvent.CLOSE_TAB, refresh); 
    function refresh() {
    alert('Refresh successfull');
    var tabId = 'scc-pt-0';
    //sforce.console.refreshPrimaryTabById(tabId);
    setTimeout(function(){ 
    sforce.console.refreshPrimaryTabById(tabId); }, 5000);
    }