Using Background Utility Items
Using Events with the Lightning Console JavaScript API
Use Page Context in the Utility Bar API
Using Page References to Open Console Workspace Tabs and Subtabs
Debugging
Previous Versions
Lightning console apps allow users to quickly find the information they need, and make edits while viewing multiple records on one screen. The Lightning Console JavaScript API gives you programmatic access to Lightning console apps, so you can fully integrate Lightning console apps with Aura components and Lightning web components while extending them to meet your business needs.
| Required Editions |
|---|
| Available in: Lightning Experience |
| Available in: Essentials, Professional, Enterprise, Performance, Unlimited, and Developer Editions Lightning console apps are available for an extra cost to users with Salesforce Platform user licenses for certain products. Some restrictions apply. For pricing details, contact your Salesforce account executive. |
The Lightning Console JavaScript API includes three libraries: the navigation item API, the utility bar API, and the workspace API.
For a full list of methods in each API, see Methods for Lightning Console JavaScript API.
You can build Lightning components using two programming models: the Lightning Web Components model and Aura Components model. Although both models can coexist and interoperate on a page, we recommend that you build your apps with Lightning Web Components, which use HTML and modern JavaScript.
Only the utility bar and workspace APIs are currently supported for Lightning web components.
Note
Lightning Console JavaScript API Syntax
Use Lightning Console JavaScript API methods in the JavaScript file of a Lightning web component or in the JavaScript controller of an Aura component.
Using Background Utility Items
Implement the lightning:backgroundUtilityItem interface to create a component that fires and responds to events without rendering in the utility bar.
Utilities that support pop-out can be “popped out” of the utility bar and into their own separate child windows.
Using Events with the Lightning Console JavaScript API
The Lightning framework uses event-driven programming, which allows you to create handlers to respond to interface events as they occur. The Lightning Console JavaScript API provides several events specific to Lightning console apps.
Use Page Context in the Utility Bar API
In both Lightning console apps and standard navigation apps, utilities can respond to the context of the current page. For a Lightning web component, use the CurrentPageReference wire adapter. For an Aura component, specify implements="force:hasRecordId" to access the recordId of the record a user is viewing.
Using Page References to Open Console Workspace Tabs and Subtabs
You can navigate to different page types, including a URL addressable custom component. To make a custom component URL addressable using LWC, use the lightning__UrlAddressable target. To make an Aura component URL addressable, implement the lightning:isUrlAddressable interface on your custom component.
Use your browser’s console and JavaScript error messages to debug Lightning pages built with the Lightning Console JavaScript API. Here are several recommendations on debugging your Lightning Console API code.
Methods for Lightning Console JavaScript API
If your org is using Lightning Experience, use Lightning Console JavaScript API methods.
Use events and handlers in your Aura components and controllers to respond to events like workspace tabs opening, closing, or gaining focus. In Lightning web components, subscribe to Aura application events using their corresponding Lightning message channels.
See Also