1

I want to define a default tab that would open every time a user opens the service cloud console.

I was thinking of fetching the tabId of the tab from the TAB Menu Navigation bar and then opening it through a hidden footer component that would be called on console load.

Has anyone come across similar requirements or does anyone know if there is a way to fetch the ID of a tab present under the navigation menu and ensure that it is always open by default?

To explain further: say I have three tabs in the navigation menu (i.e. Account, Contact and Home Page). I want the Home Page tab to be open by default every time the user opens the console.

0

You can use the toolkit methods getNavigationTabs and setSelectedNavigationTab to achieve this from within a custom console component. If you don't want users to see a widget in their footer, you can choose to hide the component during its creation.

The Visualforce page would look something like the below. You can also filter on listViewUrl if you prefer that rather than using the tab's label.

<apex:page >
    <apex:includeScript value="/support/console/36.0/integration.js"/>
    <script type="text/javascript">

        var callback = function (result) { 
           var id;
              if (result.success) { 
                var tempItem = JSON.parse(result.items);
                for (var i = 0, len = tempItem.length; i < len; i++) {
                   if(tempItem[i].label == "Home") {
                       sforce.console.setSelectedNavigationTab(null,tempItem[i].navigationTabId);
                   }
                }
              }
              else {                 
                console.log('Something is wrong!');
              }
        };
        sforce.console.getNavigationTabs(callback);
    </script>
</apex:page>

References: Toolkit doc and Custom Console Component doc

  • Thanks Paul , was not aware of NavigationTab methods – user3458117 Mar 31 '16 at 6:52

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.