Newer Version Available

This content describes an older version of this product. View Latest

force:navigateToRelatedList

Navigates to the related list specified by parentRecordId.

To navigate to a related list, set the parent record ID on the parentRecordId attribute and fire the event. For example, to display a related list for a Contact object, the parentRecordId is Contact.Id. This example displays the related cases for a contact record.

1gotoRelatedList : function (component, event, helper) {
2    var relatedListEvent = $A.get("e.force:navigateToRelatedList");
3    relatedListEvent.setParams({
4        "relatedListId": "Cases",
5        "parentRecordId": component.get("v.contact.Id")
6    });
7    relatedListEvent.fire();
8}

This event is handled by the one.app container. It’s supported in Lightning Experience, Salesforce1, and Lightning communities.

Note

Attribute Name Type Description Required?
parentRecordId String The ID of the parent record. Yes
relatedListId String The API name of the related list to display, such as “Contacts” or “Opportunities”. Yes