Salesforce Console Developer Guide
Summer '25 preview (API version 64.0)
Spring '25 (API version 63.0)
Winter '25 (API version 62.0)
Summer '24 (API version 61.0)
Spring '24 (API version 60.0)
Winter '24 (API version 59.0)
Summer '23 (API version 58.0)
Spring '23 (API version 57.0)
Winter '23 (API version 56.0)
Summer '22 (API version 55.0)
Spring '22 (API version 54.0)
Winter '22 (API version 53.0)
Summer '21 (API version 52.0)
Spring '21 (API version 51.0)
Winter '21 (API version 50.0)
Summer '20 (API version 49.0)
Spring '20 (API version 48.0)
Winter '20 (API version 47.0)
Summer '19 (API version 46.0)
Spring '19 (API version 45.0)
Winter '19 (API version 44.0)
Summer '18 (API version 43.0)
Spring '18 (API version 42.0)
Winter '18 (API version 41.0)
Summer '17 (API version 40.0)
Spring '17 (API version 39.0)
Winter '17 (API version 38.0)
Summer '16 (API version 37.0)
Spring '16 (API version 36.0)
Winter '16 (API version 35.0)
Summer '15 (API version 34.0)
Spring '15 (API version 33.0)
Winter '15 (API version 32.0)
Summer '14 (API version 31.0)
Spring '14 (API version 30.0)
No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
When to Use the Salesforce Console Integration Toolkit
Change a Visualforce Page by Using the Salesforce Console Integration Toolkit
closeTab()
disableTabClose()
focusPrimaryTabById()
focusPrimaryTabByName()
focusSidebarComponent()
focusSubtabById()
focusSubtabByNameAndPrimaryTabId()
focusSubtabByNameAndPrimaryTabName()
generateConsoleUrl()
getEnclosingPrimaryTabId()
getEnclosingPrimaryTabObjectId()
getEnclosingTabId()
getFocusedPrimaryTabId()
getFocusedPrimaryTabObjectId()
getFocusedSubtabId()
getFocusedSubtabObjectId()
getPageInfo()
getPrimaryTabIds()
getSubtabIds()
getTabLink()
isInConsole()
onEnclosingTabRefresh()
onFocusedPrimaryTab()
onFocusedSubtab()
onTabSave()
openConsoleUrl()
openPrimaryTab()
openSubtab()
openSubtabByPrimaryTabName()
refreshPrimaryTabById()
refreshPrimaryTabByName()
refreshSubtabById()
refreshSubtabByNameAndPrimaryTabId()
refreshSubtabByNameAndPrimaryTabName()
reopenLastClosedTab()
resetSessionTimeOut()
setTabUnsavedChanges()
setTabIcon()
setTabLink()
setTabStyle()
setTabTextStyle()
setTabTitle()
Methods for Primary Tabs and Subtabs
A Salesforce console displays Salesforce pages as primary tabs or subtabs. A primary tab displays the main item to work on, such as an account. A subtab displays related items, such as an account’s contacts or opportunities.
-
closeTab()
Closes a specified primary tab or subtab. Keep in mind that closing the first tab in a primary tab closes the primary tab itself. This method is only available in API version 20.0 or later. -
disableTabClose()
Prevents a user from closing a tab or a subtab. If the ID parameter doesn’t specify a tab, the enclosing tab is used. You can also use this method to re-enable a tab that has been disabled. Available in API version 36.0 or later. -
focusPrimaryTabById()
Focuses the browser on a primary tab that is already open with the specified ID. This method is only available in API version 22.0 or later. -
focusPrimaryTabByName()
Focuses the browser on a primary tab that is already open with the specified name. This method is only available in API version 22.0 or later. -
focusSidebarComponent()
Focuses the browser on a sidebar component. Use this method to focus on a component with the tab or accordion sidebar style. -
focusSubtabById()
Focuses the browser on a subtab that is already open with the specified ID. This method is only available in API version 22.0 or later. -
focusSubtabByNameAndPrimaryTabId()
Focuses the browser on a subtab that is already open with the specified name and primary tab ID. This method is only available in API version 22.0 or later. -
focusSubtabByNameAndPrimaryTabName()
Focuses the browser on a subtab that is already open with the specified name and primary tab name. This method is only available in API version 22.0 or later. -
generateConsoleUrl()
Generates a URL to a tab, or group of related tabs, in the Salesforce console. If any tabs include external URLs, then add the external URLs to the console’s allowlist so that they can display correctly.This method is only available in API version 28.0 or later. -
getEnclosingPrimaryTabId()
Returns the ID of the current primary tab. This method works within a primary tab or subtab, not within the navigation tab or custom console components. This method is only available in API version 20.0 or later. -
getEnclosingPrimaryTabObjectId()
Returns the object ID of the current primary tab, which contains a subtab. For example, a case ID or account ID. This method works within a primary tab or subtab. This method is only available in API version 24.0 or later. -
getEnclosingTabId()
Returns the ID of the tab that contains the current Visualforce page, which may be a primary tab or subtab. This method will work if the call is made within a component enclosed within a subtab. This method is only available in API version 20.0 or later. -
getFocusedPrimaryTabId()
Returns the ID of the primary tab on which the browser is focused. This method is only available in API version 25.0 or later. -
getFocusedPrimaryTabObjectId()
Returns the object ID of the primary tab on which the browser is focused. This method is only available in API version 25.0 or later. -
getFocusedSubtabId()
Returns the ID of the subtab on which the browser is focused. For example, a case ID or account ID. This method is only available in API version 25.0 or later. -
getFocusedSubtabObjectId()
Returns the object ID of the subtab on which the browser is focused. For example, a case ID or account ID. This method is only available in API version 24.0 or later. -
getPageInfo()
Returns page information for the specified tab after its content has loaded. If the tab ID is null, it returns page information for the enclosing primary tab or subtab. Note that to get the page information from a custom console component, a tabId must be passed as the first parameter to this method.This method is only available in API version 26.0 or later. -
getPrimaryTabIds()
Returns all of the IDs of open primary tabs. This method is only available in API version 26.0 or later. -
getSubtabIds()
Returns all of the IDs of the subtabs on the primary tab specified by a primary tab ID. If the primary tab ID is null, it returns the IDs of the subtabs on the current primary tab. This method can only be called from a custom console component or a detail page overwritten by a Visualforce page. This method is only available in API version 26.0 or later. -
getTabLink()
Retrieves the URL to a tab, or group of related tabs, from the Salesforce console. This method is only available in API version 28.0 or later. -
isInConsole()
Determines if the page is in the Salesforce console. This method is only available in API version 22.0 or later. -
onEnclosingTabRefresh()
Registers a function to call when the enclosing tab refreshes. This method is only available in API version 24.0 or later. -
onFocusedPrimaryTab()
Registers a function to call when the focus of the browser changes to a different primary tab. This method is only available in API version 25.0 or later. -
onFocusedSubtab()
Registers a function to call when the focus of the browser changes to a different subtab. This method is only available in API version 24.0 or later. -
onTabSave()
Registers and calls a callback method when a user clicks Save in a subtab’s Unsaved Changes dialog box. When using this method, call setTabUnsavedChanges() in the callback method. This notifies the console that the custom save operation completed. In the call to setTabUnsavedChanges(), pass the first parameter as false to indicate a successful save or true to indicate an unsuccessful save. This method is only available in API version 28.0 or later. -
openConsoleUrl()
Opens a URL created by the generateConsoleUrl() method (a URL to a tab, or group of related tabs, in the Salesforce console). This method is only available in API version 28.0 or later. -
openPrimaryTab()
Opens a new primary tab to display the content of the specified URL, which can be relative or absolute. You can also override an existing tab. This method is only available in API version 20.0 or later. -
openSubtab()
Opens a new subtab (within a primary tab) that displays the content of a specified URL, which can be relative or absolute. You can also override an existing subtab. Use to open a new subtab on a primary tab via the primary tab's ID. This method is only available in API version 20.0 or later. -
openSubtabByPrimaryTabName()
Opens a new subtab (within a primary tab) that displays the content of a specified URL, which can be relative or absolute. You can also override an existing subtab. Use to open a new subtab on a primary tab via the primary tab's name. This method is only available in API version 22.0 or later. -
refreshPrimaryTabById()
Refreshes a primary tab specified by ID, including its subtabs. This method can't refresh subtabs with URLs to external pages or Visualforce pages. This method is only available in API version 22.0 or later. -
refreshPrimaryTabByName()
Refreshes a primary tab specified by name, including its subtabs. This method can't refresh subtabs with URLs to external pages or Visualforce pages. This method is only available in API version 22.0 or later. -
refreshSubtabById()
Refreshes a subtab with the last known URL with a specified ID. This method can't refresh a subtab if the last known URL is an external page or a Visualforce page. This method is only available in API version 22.0 or later. -
refreshSubtabByNameAndPrimaryTabId()
Refreshes a subtab with the last known URL with the specified name and primary tab ID. This method can't refresh a subtab if the last known URL is an external page or a Visualforce page. This method is only available in API version 22.0 or later. -
refreshSubtabByNameAndPrimaryTabName()
Refreshes a subtab with the last known URL with the specified name and primary tab name. This method can't refresh a subtab if the last known URL is an external page or a Visualforce page. This method is only available in API version 22.0 or later. -
reopenLastClosedTab()
Reopens the last closed primary tab, and any of its subtabs that were open, the moment it was closed. This method is only available in API version 35.0 or later. -
resetSessionTimeOut()
Resets a session timeout for a console app. This method ensures that users can continue working on Visualforce pages without being prompted to log back in to the console when they return to a console tab or console component. This method is only available in API version 24.0 or later. -
setTabUnsavedChanges()
Sets the unsaved changes icon () on subtabs to indicate unsaved data. This method is only available in API version 23.0 or later.
-
setTabIcon()
Sets an icon on the specified tab. If a tab is not specified, the icon is set on the enclosing tab. Use this method to customize a tab’s icon. This method is only available in API version 28.0 or later. -
setTabLink()
Sets a console tab’s URL attribute to the location of the tab’s content. Use this method to generate secure console URLs when users navigate to tabs displaying content outside of the Salesforce domain.This method is only available in API version 28.0 or later. -
setTabStyle()
Sets a cascading style sheet (CSS) on the specified tab. If a tab is not specified, the CSS is set on the enclosing tab. Use this method to customize a tab’s look and feel. This method is only available in API version 28.0 or later. -
setTabTextStyle()
Sets a cascading style sheet (CSS) on a specified tab’s text. If a tab is not specified, the CSS is set on the enclosing tab’s text. Use this method to customize a tab’s text style. This method is only available in API version 28.0 or later. -
setTabTitle()
Sets the title of a primary tab or subtab. This method is only available in API version 20.0 or later.