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 supported in Salesforce1 only. If used outside of Salesforce1, this event won’t be handled properly.

Note

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