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
ChristadChristad 

Service Console

Hi

 

I have enabled the Service Cloud console and added Cases, Contacts and Accounts in the console navigator drop down list box, but the customer would like to have Home, Opportunities, Reports and Dashboards automatically appear as separate primary tabs on the console as soon as you select the Service Console application. The idea is that the standard applications are accessible automatically via the primary tabs and any other apps such as Cases, Accounts etc are available via the drop down navigator.

 

I have looked at the Service Console Integration toolkit but am still unsure how to code the customer requirements. The sample code in the documentation describes how to write the visual force pages to invoke a primary tab using buttons and links but not how to invoke eg the standard Opportunities and Reports pages automatically as primary tabs upon selecting the service console.

 

I have used the following sample code to test the way to develop it but Im not sure how to invoke more than one primary tab displaying eg Reports and Opportunities, and how to call this automatically as soon as the service console is selected.

 

<apex:page standardController="Case">
    <apex:includeScript value="/support/console/22.0/integration.js"/>
        <A HREF="#" onClick="testIsInConsole();return false"> Click here to check if the page is in the Service Cloud console</A><br/><br/>
        <script type="text/javascript">
        function testIsInConsole() {
            if (sforce.console.isInConsole()) {
                alert("in console");
            } else {
                alert("not in console");
            }
        }

        function openPrimaryTab() {
            sforce.console.openPrimaryTab(null, 'http://www.google.com', true, 'Opportunities');
        }

        //The callback function that openSubtab will call once it's got the ID for its primary tab
        var callOpenSubtab=function callOpenSubtab(result) {
            sforce.console.openSubtab(result.id,'http://www.yahoo.com', true, 'yahoo');
        };
        
        function openSubtab() {
            sforce.console.getEnclosingPrimaryTabId(callOpenSubtab);
        }
        
        //Sets the title of the current tab to "SFDC"
        function setTitle() {
            sforce.console.setTabTitle('SFDC');
        }
        
        //The callback function that closeTab will call once it's got the ID for its tab
        var callCloseTab= function callCloseTab(result) {
            sforce.console.closeTab(result.id);
        }
        
        function closeTab() {
            sforce.console.getEnclosingTabId(callCloseTab);

        }
    </script>

    <A HREF="#" onClick="openPrimaryTab();return false">Open A Primary Tab</A>
    <p/><A HREF="#" onClick="openSubtab();return false">Open A Subtab</A>
    <p/><A HREF="#" onClick="setTitle();return false">Set Title to SFDC</A>
    <p/><A HREF="#" onClick="closeTab();return false">Close This Tab</A>
</apex:page>

 

Has anyone tried to do something similar ?

 

Many Thanks

 

Best Answer chosen by Christad
Jatin.jainJatin.jain

Hi

You need to write piece of code in window.onload.

Have a look at below link : this is done for subtabs. You just have to do for Primary tabs

 

http://wiki.developerforce.com/page/Open_Multiple_Subtabs