I want to navigate to list view on click of button in a case record. Even if the multiple cases tabs are open I would like to get focus to list view on button click in lighting. is this possible to do. Do any one have any idea on this. Thanks in advance.


Its given in the documentation:

Navigate To List

in CMP:

<lightning:button type="button" name="NavigateToListView" onclick="{!c.navigateToListView}">Navigate</lightning:button>

in JS: (Generically to open listview)

navigateToListView: function (component, event, helper) {
    const navEvent = $A.get("e.force:navigateToList");
        "listViewId": '00B7F000001nIdaUAE', // hardcoded for example
        "listViewName": 'My Cases',
        "scope": "Case"

If you are on a console tab and would like to open a listView for case as a primary tab then use: (Console related)

    var workspaceAPI = component.find("workspace");
        url: '/lightning/o/Case/list?filterName=00B7F000001nIdaUAE', // hardcoded for example
        focus: true
    }).catch(function(error) {

And if you already have your listview opened in the naviagtion item then use navigation api to just focus back to the listview. (Console related)

    navigationItemAPI.focusNavigationItem().then(function(response) {
    }).catch(function(error) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.