You need to sign in to do that
Don't have an account?

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>
<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>
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: 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