Note: This release is in preview. Features described here don’t become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can’t guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.
setTabTitle()
Sets the title of a primary tab or subtab. This method is only available in API version 20.0 or later.
Syntax
1sforce.console.setTabTitle(tabTitle:String, (optional)tabID:String)Arguments
Sample Code–Visualforce API Version 20.0 or Later
1<apex:page standardController="Case">
2 <A HREF="#" onClick="testSetTabTitle();return false">
3 Click here to change this tab's title</A>
4
5 <apex:includeScript value="/support/console/68.0/integration.js"/>
6 <script type="text/javascript">
7 function testSetTabTitle() {
8 //Set the current tab's title
9 sforce.console.setTabTitle('My New Title');
10 }
11 </script>
12</apex:page>Response
None
Sample Code–Visualforce API Version 25.0 or Later
1<apex:page>
2 <A HREF="#" onClick="testSetTabTitle();return false">
3 Click here to change the title of the focused primary tab</A>
4
5 <apex:includeScript value="/support/console/68.0/integration.js"/>
6 <script type="text/javascript">
7 function testSetTabTitle() {
8 sforce.console.getFocusedPrimaryTabId(function(result) {
9 sforce.console.setTabTitle('My New Title', result.id);
10 });
11 }
12 </script>
13</apex:page>Response
None