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
REKREK 

Not Able to Set Title of Tab in Console after Case Creation

Hi , I set The Console VF Page Tab Name As "Case Creation" But It Ovewrites after Case Saved and Where I want to display The Name of Th Record.
<apex:page standardController="Case" extensions="consoleTab"  sidebar="true" showHeader="true" >

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

        <body onload="testSetTabTitle()"/>

          </script>
        <apex:commandLink value=" Create New Case" action="{!goToCaseEditPage}" />      
       <br></br>
    </apex:form>              
    <apex:includeScript value="/support/console/35.0/integration.js"/>
    <script type="text/javascript">
        var g_subId;
        function testGetFocusedSubtabId() {
            sforce.console.getFocusedSubtabId(showTabId);
        }
        var showTabId = function showTabId(result) {
                 g_subId = result.id;
              };
        function testSetTabTitle() {
            //Set the current tab's title
            sforce.console.setTabTitle('Case Creation');
        }
        function testOpenSubtab() {
            sforce.console.getEnclosingPrimaryTabId(openSubtab);
        }

        var openSubtab = function openSubtab(result) {
             var primaryTabId = result.id;
            sforce.console.openSubtab(primaryTabId , '/500/e?cas7=Escalated&cas11=Phone', true, '', g_subId, openSuccess, null);
        };


    </script>
</apex:page>
NagendraNagendra (Salesforce Developers) 
Hi Rek,

Please find the below solution which was addressed for similar post in stack exchange community.

Your page isn't a valid HTML page. You have a body tag inside of a script tag, and it's trying to call an out-of-scope function. I'd also recommend removing the duplicate calls to integration.js and using a more robust method to use on load. I'd also suggest using your browser's built-in debugging tools to help pinpoint errors when writing JavaScript.

Sample working code is below:
<apex:page standardController="Case" extensions="consoleTab" sidebar="true" showHeader="true">
    <apex:form>
        <apex:commandLink value=" Create New Case" action="{!goToCaseEditPage}" />
        <br></br>
    </apex:form>
    <apex:includeScript value="/support/console/35.0/integration.js" />
    <script type="text/javascript">

    var oldonload = window.onload; 
      if (typeof window.onload != 'function') 
      { 
         window.onload = testSetTabTitle; 
      } 
      else
      { 
          window.onload = function()  
          { 
            if (oldonload) 
            { 
               oldonload(); 
            } 
            testSetTabTitle(); 
          } 
       } 

        var g_subId;
        function testGetFocusedSubtabId() {
            sforce.console.getFocusedSubtabId(showTabId);
        }
        var showTabId = function showTabId(result) {
            g_subId = result.id;
        };
        function testSetTabTitle() {
            //Set the current tab's title
            sforce.console.setTabTitle('Case Creation');
        }
        function testOpenSubtab() {
            sforce.console.getEnclosingPrimaryTabId(openSubtab);
        }
        var openSubtab = function openSubtab(result) {
            var primaryTabId = result.id;
            sforce.console.openSubtab(primaryTabId, '/500/e?cas7=Escalated&cas11=Phone', true, '', g_subId, openSuccess, null);
        };
    </script>
</apex:page>
Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue and becomes a proper solution for others who are looking for similar issue.

Regards,
Nagendra.P