2

I may be overlooking something, but when I browse down a listview in Console, I don't want all the subtabs to remain openend up. Is there a setting or another way to auto close subtabs when focus on the object is lost?

4

Tabs don't automatically close in the console when you leave them. Similar to a browser, you would need to manually close the tabs if you want them closed.

However, you could do something like using the toolkit to automatically close all tabs except the one you're focused on. For example, create a VF page like this and add it as a footer component in your console app.

<apex:page showHeader="true">
<apex:includeScript value="/support/console/35.0/integration.js" />

<script type="text/javascript">
var focusedTabId = "";
var eventHandler = function (result) {
    sforce.console.getFocusedPrimaryTabId(function(result) { 
        focusedTabId=result.id;
        thereCanBeOnlyOne();
    });
}        

sforce.console.onFocusedSubtab(eventHandler);

var thereCanBeOnlyOne = function() { 
    sforce.console.getPrimaryTabIds(function(result) { 
        for(i=0;i<result.ids.length;i++){
            if(result.ids[i] != focusedTabId) {
               sforce.console.closeTab(result.ids[i]); 
            }
        }

    });
}
</script>

</apex:page>

If that's not exactly what you want, the toolkit has other methods to allow you to control the user's experience and tabs in a way that you choose.

https://developer.salesforce.com/docs/atlas.en-us.api_console.meta/api_console/sforce_api_console_intro.htm

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.