0

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.

1
0

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");
    navEvent.setParams({
        "listViewId": '00B7F000001nIdaUAE', // hardcoded for example
        "listViewName": 'My Cases',
        "scope": "Case"
    });
    navEvent.fire();
},

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");
    workspaceAPI.openTab({
        url: '/lightning/o/Case/list?filterName=00B7F000001nIdaUAE', // hardcoded for example
        focus: true
    }).catch(function(error) {
        console.log(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) {
        console.log(response);
    }).catch(function(error) {
            console.log(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.