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).
| Name | Type | Description |
|---|---|---|
url | string | Console URL representing the array of URLs passed into Salesforce. |
focus | boolean | Optional. If true, the workspace tab opens and displays immediately. If false, the workspace tab opens in the background. |
labels | string[] | Optional. An array of labels for the opened tabs. The order that the tabs appear in the URL should match the order in the array. Use an emptry string if you don’t want to set any labels. |
This component has a button that, when pressed, opens a workspace using the openConsoleUrl()method.
Component code:
Controller code:
This method returns a promise that, upon success, resolves to the tabId of the active tab.