2

I added a custom button to Contacts that when clicked in the Service Console opens a VF page in a subtab. However, the tab name is currently blank. How can I add/change the name of this SubTab?

This is the code opening the tab.

srcUp("https://na1.salesforce.com/apex/service_cloud_console_flow_1");

Thanks.

1

Did you try with this:

Service console integration toolkit has a method named setTabTitle

Ex:

<script type="text/javascript">
        sforce.console.getFocusedPrimaryTabId(function(result) {
               // Result.id is the id of tab
               sforce.console.setTabTitle('Change Title', result.id);
        });
</script>

Reference: http://www.salesforce.com/us/developer/docs/api_console/index.htm

  • What if I want to change the title of a standard page--like a Case? I want to add some text to the case title--like 2015-00008752. Is there a place to sneak-in some Javascript without going all VF? – tggagne Feb 23 '16 at 15:51
1

I had exact issue and able to fixed, here is the how I did it:

source

<apex:includeScript value="/support/console/20.0/integration.js"/>
    <script type="text/javascript">
        function testSetTabTitle() {
            //Set the current tab's title
            sforce.console.setTabTitle('Lead: {!Lead.Name}');
        }
        var pageLoad = window.onload;
          window.onload = function() {
                if (pageLoad) {
                        pageLoad();
                }
                  testSetTabTitle();
          }
    </script>
0

I am not sure that is possible with this internal SFDC function. As mentioned in this topic (The Service Cloud Console – Working with Buttons and Links):

when opening Salesforce.com pages, the tab title is set automatically.

and

when opening Visualforce pages, the Visualforce page is responsible for setting its tab title.

But... Why not using a native service cloud console integration API? It is working well for me:

{!REQUIRESCRIPT("/support/console/30.0/integration.js")}

// Use the results primary tab id and open a new subtab
var openSubtab = function(result){            
    sforce.console.openSubtab(result.id, 'your page url', true, 'page title', null);    
};
sforce.console.getEnclosingPrimaryTabId(openSubtab);

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.