Methods for Navigation Items in Lightning Experience
Lightning console apps display an item menu that lets users select navigation items, such as cases, contacts, and accounts. Salesforce admins choose which navigation items to display in the navigation menu. Both Lightning Web Components (LWC) and Aura Components support the navigation items methods, with usage differences noted on each method.
These methods work with navigation items in Lightning console apps.
-
focusNavigationItem() for Lightning Experience
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. This method works only in Lightning console apps.
-
getNavigationItems() for Lightning Experience
Returns information about all the items in the navigation menu. This method works only in Lightning console apps.
-
getSelectedNavigationItem() for Lightning Experience
Returns information about the selected navigation item. This method works only in Lightning console apps.
-
refreshNavigationItem() for Lightning Experience
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. This method works only in Lightning console apps.
-
setSelectedNavigationItem() for Lightning Experience
Sets the selected navigation item to a specific ID. This method works only in Lightning console apps.