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.



4 Answers 4


Did you try with this:

Service console integration toolkit has a method named setTabTitle


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

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
    Commented Feb 23, 2016 at 15:51

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


<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) {

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.


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:


// 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);    

I achievedenter image description here this using Aura Component and Controller.

Below image shows case subject instead of case number.

  • 2
    As with your other answer, this isn't a helpful answer. You need to share your code and explain how it works.
    – Derek F
    Commented Dec 4, 2023 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .