Navigation Item API
lightning:navigationItemAPI
Work with navigation items in Lightning console apps, where navigation items display in an item menu. This component requires API version 43.0 and later. For Aura components only.
For Use In
Lightning Experience
lightning:navigationItemAPI allows you to access methods for programmatically controlling navigation items in Lightning console apps, where navigation items display in an item menu.
To access the methods, create an instance of the lightning:navigationItemAPI component and assign an aura:id attribute to it.
This example creates a button that focuses on the selected navigation object when clicked. If split view is collapsed, the object's list view is opened.
The button calls the following client-side controller.
This component provides similar functionality to some of the Salesforce Console Integration Toolkit JS APIs available in Salesforce Classic.
This component supports the following methods. For more information on these methods, see the Salesforce Console Developer Guide.
focusNavigationItem()
Focuses on the selected navigation object and opens the object's home page. Typically, standard and custom objects open the object's list view. If split view is open, focus remains on the selected navigation object. Returns a Promise. Success resolves to true. The Promise will be rejected on error.
getNavigationItems()
Returns information about all the items in the item menu. Returns a Promise. Success resolves to an array of navigationItemInfo objects. The Promise will be rejected on error.
getSelectedNavigationItem()
Returns information about the selected navigation item. Returns a Promise. Success resolves to a navigationItemInfo object. The Promise will be rejected on error.
setSelectedNavigationItem({developerName})
developerName(string): The ID of the navigation item to select.
Updates the selected navigation item. Returns a Promise. Success resolves to true. The Promise will be rejected on error.
refreshNavigationItem()
Refreshes the selected navigation object's home page. Typically, standard and custom objects open the object's list view. If split view is open, it's refreshed. Returns a Promise. Success resolves to true. The Promise will be rejected on error.