Loading

Lightning Component 'force:navigateToRelatedList' related list view errors

Publiceringsdatum: May 15, 2026
Beskrivning

 

Within a Lightning Experience custom detail page app, using the force:navigateToRelatedList Lightning Aura event may result in errors. When the force:navigateToRelatedList event fires, the expected behavior is to navigate to a new page displaying all records for a related list.
Instead, you may see one or both of the following errors:

  • "This list view isn't available in Lightning Experience. To see this list view, use Salesforce Classic or switch to another list view."
  • "Unfortunately, the related list you're trying to view isn't in the layout. Please get in touch with your administrator."

How the event works in a Lightning Aura component:
In a Lightning Aura component, a link element with an onclick handler calls a controller function (for example, openRelatedList). The controller function retrieves the force:navigateToRelatedList application event, sets the relatedListId to the custom relationship API name (for example, RelationshipName__r) and the parentRecordId from the component's record ID attribute, then fires the event. If the related list is not included in the object's page layout, this event will produce the errors listed above.

 

Lightning Component Example

In the Component:

<a href="javascript:void(0);" onclick="{!c.openRelatedList}">View all</a>

In the Controller:

openRelatedList: function(component, _event){
   var relatedListEvent = $A.get("e.force:navigateToRelatedList");
   relatedListEvent.setParams({
      "relatedListId": "RelationshipName__r",
      "parentRecordId": component.get("v.recordId")
   });
   relatedListEvent.fire();
}
Lösning

 

Always include the related list in the relevant object page layout in order to use the force:navigateToRelatedList Lightning Aura event. This is necessary even when you intend to override the standard page layout with a custom Lightning app page.
Possible Use Cases:
Use Case 1: You do not want to display the default related lists at all.

  1. Include the default related lists in the page layout anyway (this is required for the event to work).
  2. Do not include the default "Related Lists" or "Related List" components in the Lightning detail page app.
  3. Include the component that uses the force:navigateToRelatedList event in the Lightning detail page app.

Use Case 2: You want to display some default related lists and some custom components.

  1. Include all the default related lists in the page layout anyway.
  2. Do not include the default "Related Lists" component in the Lightning detail page app.
  3. Use individual "Related List" components for each default displayed related list you want to show in the Lightning detail page app.
  4. Include the component(s) using the force:navigateToRelatedList event in the Lightning detail page app.

 

Ytterligare resurser
  • force:navigateToRelatedList in the Lightning Component Library
  • Lightning App Builder Overview
Knowledge-artikelnummer

000384080

 
Laddar
Salesforce Help | Article