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 allowlisted with CSP directives via Trusted URLs. This table lists the Salesforce Console Integration Toolkit methods that you can use in Lightning Console JavaScript API starting with API version 42.0.

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

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

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

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

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 Trusted URLs list.

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 Checkmark icon
refreshPrimaryTabById() See notes See notes The fullRefresh argument isn’t supported in the Lightning API.
refreshPrimaryTabByName() Red x mark Checkmark icon
refreshSubtabById() See notes See notes The fullRefresh argument isn’t supported in the Lightning API.
refreshSubtabByNameAndPrimaryTabId() Red x mark Red x mark
refreshSubtabByNameAndPrimaryTabName() Red x mark Red x mark
reopenLastClosedTab() Red x mark Red x mark
resetSessionTimeOut() Red x mark Red x mark
setTabUnsavedChanges() Red x mark Red x mark
setTabIcon() See notes 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 Red x mark
setTabStyle() Red x mark Red x mark
setTabTextStyle() Red x mark Red x mark
setTabTitle() Checkmark icon Checkmark icon

Methods for Application-Level Custom Console Components

LWC doesn’t currently support working with these methods.

Note

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

Methods for Navigation Tabs

LWC doesn’t currently support working with these methods.

Note

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

LWC doesn’t currently support working with these methods.

Note

Methods for Console Events

LWC doesn’t currently support working with these methods.

Note

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