Newer Version Available
force:navigateToRelatedList
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}| 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 |