Newer Version Available

This content describes an older version of this product. View Latest

Classic Console API Methods Supported in the Lightning Console API

Visualforce pages and third-party web tabs that use some Salesforce Console Integration Toolkit methods work in Lightning Experience as-is. Just point to the latest version of the toolkit script in your Visualforce pages or third-party web tabs. Third-party content must be whitelisted in the CSP Trusted Sites. This table lists the Salesforce Console Integration Toolkit methods that you can use in Lightning Console JavaScript API starting with API version 42.0.

Only API versions 42.0 and above of the Salesforce Console Integration Toolkit are supported in the Lightning Console JavaScript API. Only API versions 43.0 and above are supported in Open CTI.

Important

Salesforce Console Integration Toolkit methods that aren’t supported in Lightning Experience result in a failure error message.

Methods for Primary Tabs and Subtabs

Methods using objectId return 18-character, case-insensitive record IDs when invoked from within a Lightning console. When invoked from within a Salesforce Classic console, they return 15-character, case-sensitive record IDs.

Workspace tab and subtab IDs in a Lightning console use a different format from Salesforce Classic console primary tab and subtab IDs. Any code that validates the format of tab IDs must be updated or removed to account for the change. A Salesforce Classic console tab ID can look like scc-pt-1 or scc-st-1. A Lightning console tab ID looks like ctab1 or ctab1_3.

Note

Salesforce Classic Method Supported in Lightning Console Notes About Use in Lightning Console
closeTab() Checkmark icon
disableTabClose() Checkmark icon
focusPrimaryTabById() Checkmark icon
focusPrimaryTabByName() Red x mark
focusSidebarComponent() Red x mark
focusSubtabById() Checkmark icon
focusSubtabByNameAndPrimaryTabId() Red x mark
focusSubtabByNameAndPrimaryTabName() Red x mark
generateConsoleUrl() Red x mark
getEnclosingPrimaryTabId() Checkmark icon
getEnclosingTabId() Checkmark icon
getFocusedPrimaryTabId() Checkmark icon
getFocusedPrimaryTabObjectId() Checkmark icon
getFocusedSubtabId() Checkmark icon
getFocusedSubtabObjectId() Checkmark icon
getPageInfo() See notes These fields aren’t supported and aren’t returned in the response:
  • object
  • displayName
  • accountId
  • contactId
  • personAccount
getPrimaryTabIds() Checkmark icon
getSubtabIds() Checkmark icon
getTabLink() See notes The level argument sforce.console.TabLink.PARENT_AND_CHILDREN isn’t supported.
isInConsole() Checkmark icon
onEnclosingTabRefresh() Checkmark icon
onFocusedPrimaryTab() Checkmark icon
onFocusedSubtab() Checkmark icon Utility items aren’t supported in the Lightning API.
onTabSave() Red x mark
openConsoleUrl() Red x mark
openPrimaryTab() See notes

Make sure to add third-party domains to the CSP Trusted Sites list.

Note

The following aren’t supported in the Lightning API:
  • id argument
  • name argument. As an alternative, save the tabId that’s returned and use it in your API calls.
openSubtab() See notes

Make sure to add third-party domains to the CSP Trusted Sites list.

Note

The following aren’t supported in the Lightning API:
  • id argument
  • name argument. As an alternative, save the tabId that’s returned and use it in your API calls.
openSubtabByPrimaryTabName() Red x mark
refreshPrimaryTabById() See notes The fullRefresh argument isn’t supported in the Lightning API.
refreshPrimaryTabByName() Red x mark
refreshSubtabById() See notes The fullRefresh argument isn’t supported in the Lightning API.
refreshSubtabByNameAndPrimaryTabId() Red x mark
refreshSubtabByNameAndPrimaryTabName() Red x mark
reopenLastClosedTab() Red x mark
resetSessionTimeOut() Red x mark
setTabUnsavedChanges() Red x mark
setTabIcon() See notes Only Salesforce Lightning Design System icons are supported for iconUrl. URLs and custom icons aren’t supported.
Sample supported values:
  • sforce.console.setTabIcon(“standard:email”)
  • sforce.console.setTabIcon(“action:new”)
  • sforce.console.setTabIcon(“custom:custom1”)
setTabLink() Checkmark icon
setTabStyle() Red x mark
setTabTextStyle() Red x mark
setTabTitle() Checkmark icon

Methods for Application-Level Custom Console Components

The following methods must be called from within a Lightning utility.

Methods for Navigation Tabs

Salesforce Classic Method Supported in Lightning Console Notes About Use in Lightning Console
focusNavigationTab() Checkmark icon
getNavigationTabs() Checkmark icon
getSelectedNavigationTab() Checkmark icon
refreshNavigationTab() Checkmark icon
setSelectedNavigationTab() Red x mark

Methods for Omni-Channel

Methods for Console Events

Salesforce Classic Method Supported in Lightning Console Notes About Use in Lightning Console
addEventListener() Checkmark icon sforce.console.ConsoleEvent.CONSOLE_LOGOUT isn’t supported in the Lightning API.

sforce.console.ConsoleEvent.CLOSE_TAB returns the ID of the closed tab only. The Lightning API doesn’t return the objectId or the tabObjectId.

The Lightning API doesn’t return special message responses from custom keyboard shortcuts. However, if the response is from a console event, the message includes payload details.

fireEvent() See notes fireEvent() returns success true even when eventListeners for the given eventType are removed.
removeEventListener() Checkmark icon