function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
leduc datleduc dat 

How to get relatedlistId for custom object?

I want to show a related list view of the Student__c custom object which has Student__c.className__c = Class__c.id from the Class__c custom object, but the related list not showing up and i got this error : "Unfortunately, the related list you're trying to view isn't in the layout. Please get in touch with your administrator." Please help me or let me know what i was wrong. Any help will be appreciated.
var relatedListEvent = $A.get("e.force:navigateToRelatedList");
    relatedListEvent.setParams({
        "relatedListId": "Student__c.className__c",
        "parentRecordId": component.get("v.recordId") //recordId = Class__c.id 
    });
    relatedListEvent.fire();

 
ShivankurShivankur (Salesforce Developers) 
Hi Leduc,

Please check out this help article (https://help.salesforce.com/articleView?id=000320285&type=1&mode=1) and the details about this error

Hopefully, you will be able to resolve this with it.

Please don't forget to mark as Best Answer so that it can help others in the future.

Thanks.