Methods for Workspace Tabs and Subtabs in Lightning Experience
A Lightning console app displays Salesforce pages as workspace tabs or subtabs. A workspace tab displays the main work item or record, such as an account. A subtab displays related records, such as an account’s contacts or opportunities.
These methods work with workspace tabs and subtabs in Lightning console apps. Both Lightning Web Components (LWC) and Aura Components are supported unless otherwise specified.
Keep in mind that tabIds are case sensitive.
-
addToBrowserTitleQueue() for Lightning Experience
Adds a string to a list of titles that rotate in the browser title bar every three seconds.This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC).
-
closeTab() for Lightning Experience
Closes a workspace tab or subtab. This method works only in Lightning console apps.
-
disableTabClose() for Lightning Experience
Prevents a workspace tab or subtab from closing. This method removes the close button from a tab or subtab, and disables the keyboard shortcuts that close tabs and subtabs. This method works only in Lightning console apps.
-
focusTab() for Lightning Experience
Focuses a workspace tab or subtab. This method works only in Lightning console apps.
-
generateConsoleUrl() for Lightning Experience
Generates a URL for a workspace tab and its subtabs. This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC).
-
getAllTabInfo() for Lightning Experience
Returns information about all open tabs. This method works only in Lightning console apps.
-
getEnclosingTabId() for Lightning Experience
Returns the ID of the enclosing tab. This method isn’t supported for Lightning Web Components (LWC).
-
getFocusedTabInfo() for Lightning Experience
Returns information about the focused workspace tab or subtab. This method works only in Lightning console apps.
-
getTabInfo() for Lightning Experience
Returns information about the specified tab. This method works only in Lightning console apps.
-
getTabURL() for Lightning Experience
Returns the URL of the specified tab. This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC).
-
isConsoleNavigation() for Lightning Experience
Determines whether the app it’s used within uses console navigation. This method isn’t supported for Lightning Web Components (LWC).
-
isSubtab() for Lightning Experience
Checks whether a tab is a subtab. This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC).
-
openConsoleUrl() for Lightning Experience
Opens a URL generated by
generateConsoleUrl(). This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC). -
openSubtab() for Lightning Experience
Opens a subtab within a workspace tab. If the subtab is already open, the subtab is focused. This method works only in Lightning console apps.
-
openTab() for Lightning Experience
Opens a new workspace tab. If the tab is already open, the tab is focused.
-
refreshTab() for Lightning Experience
Refreshes a workspace tab or a subtab specified by
tabId. Keep in mind that the first subtab has the sametabIdas the workspace tab. This method works only in Lightning console apps. -
removeFromBrowserTitleQueue() for Lightning Experience
Removes a string from a list of titles that rotate in the browser title bar every three seconds. This method works only in Lightning console apps. This method isn’t supported for Lightning Web Components (LWC).
-
setTabHighlighted() for Lightning Experience
Highlights the specified tab with a different background color and a badge. Tab highlights don’t persist after reloading a Lightning console app. This method works only in Lightning console apps.
-
setTabIcon() for Lightning Experience
Sets the icon and alternative text of the specified tab. This method works only in Lightning console apps.
-
setTabLabel() for Lightning Experience
Sets the label of the specified tab. This method works only in Lightning console apps.
-
EnclosingTabId Context Wire Adapter for Lightning Experience
Returns the ID of the enclosing tab or subtab. This wire adapter is available for Lightning Web Components (LWC) only.
-
IsConsoleNavigation Context Wire Adapter for Lightning Experience
Determines whether the app it’s used within uses console navigation. This wire adapter is available for Lightning Web Components (LWC) only.