Navigate To Related List (Beta)
force:navigateToRelatedList
Navigates to the related list specified by parentRecordId.
For Use In
Lightning Experience, Experience Builder Sites, Salesforce Mobile App
This event enables you to navigate to the related list specified by parentRecordId.
We recommend using the lightning:navigation component with the standard__recordRelationshipPage page type instead.
For more information, see the Lightning Aura Components Developer Guide.
To navigate to a related list, set the parent record ID on the parentRecordId attribute and fire the event.
This example displays the related cases on a record and assumes that your component implements the force:hasRecordId and flexipage:availableForRecordHome interfaces. It uses the recordId attribute provided by the force:hasRecordId interface. Implementing these interfaces means that you can drag-and-drop the component to the record pages you want via the Lightning App Builder, such that it can navigate to related cases on an account record or contact record page, or any other record pages that support the case related list.
Each object supports a subset of related lists. The page layout editor shows the related lists supported for each object. For example, account records support these related lists: Assets, Cases, Contacts, Opportunities, among many others.
However, not all related lists are automatically available in your org. For example, the Contacts to Multiple Accounts feature must be enabled for the “Related Contacts” (AccountContactRelations) related list to be available. To identify the relatedListId value of a related list, navigate to the related list and observe the URL token /rlName/<relatedListId>/view that’s appended to the Salesforce URL. However, don’t hard code the URL token in your component markup or JavaScript code as it might change in future releases.
This event is handled by the one.app container. It’s supported in Lightning Experience, the Salesforce mobile app, and Aura-based Experience Builder sites.
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
entityApiName | The API name of the related list. | string | ||
parentRecordId | The ID of the parent record. | string | ![]() | |
relatedListId | The API name of the related list to display. For standard objects it is typically the related list's entity api name in plural form, such as 'Contacts' or 'Opportunities'. For custom objects it takes the form of '{YourCustomRelationshipLabel}__r' | string | ![]() |
