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).

To retrieve the URL of a specified tab in LWC, use getTabInfo().

NameTypeDescription
tabIdstringID of the tab for which to retrieve the URL.

This component has a button that, when pressed, opens a tab and uses the getTabURL() method to print the new tab’s URL to the developer console.

Component code:

Controller code:

The relative URL used in this example is a placeholder. To try this example yourself, use a relative URL with a record ID from your org.

This method returns a promise that, upon success, resolves to the URL of the specified tab.