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
Zoe FanZoe Fan 

Related Record List Component on Community - What is Parent Record ID

Hi there,

I am trying to add a "Related Record List" Component in my Community on my custom object (called Payment Profiles) details page. I want to display a related list from the related look-up field. In this case, the related field is "Counterpart__c" The component requires "Parent Record ID" and the Related List Name.
"Related Record List" Component
I've tried:
{!Counterpart__c}
{!Counterpart__c.Id}
{!Counterpart__r}
{!Counterpart__r.Id}
{!recordId.Counterpart__c}
{!recordId.Counterpart__c.Id}
{!recordId.Counterpart__r}
{!recordId.Counterpart__r.Id}

Granted I haven't published and tested each of these options, I am just relying on the preview in the community builder which says "This component has no data". Can you let me know what the syntax was for determining the ID of a parent record?

Thanks,
Zoe
AbhishekAbhishek (Salesforce Developers) 
Hi Zoe,

Try the suggestions as mentioned in the below blogs,

https://trailblazers.salesforce.com/answers?id=9063A000000eUA3QAM

https://salesforce.stackexchange.com/questions/278239/trying-to-add-related-record-list-to-community

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
Zoe FanZoe Fan
Thanks Abhishek. I tried to read your 2 links but still cannot get the correct syntax for the Parent Record ID.

Community

I have tried to put {!recordId.Counterpart__c} on the Parent Record ID but still the component cannot generate any data.

On Lightning, I was able to add the related list component by selecting "Counterpart" on the Parent Record field. I just wanted to show the same compenent / content in the community by entering the correct Parent ID (Since it is not allowed to search on the field on the above community component)

Keep in mind that the Financial Highligts is related object under account, not the payment profile. The payment profile is a custom object with an account lookup field called "Counterpart".
Therefore, the component "Related List - Single" would not work as the Financial Highlights object is not directly related to payemnt profile objects.
User-added image

Would be much appreciated if you can give me an example of what should be entered into the "Parent ID" field for standard use on this "Related Record List" standard component.
Jaap van der MolenJaap van der Molen
I have the same issue. Here's an idea to upvote: https://trailblazer.salesforce.com/ideaView?id=0873A0000003bCSQAY
Lily ZeringueLily Zeringue
We have the exact same issue also.  Has anyone found a workaround? 
Robbie EganRobbie Egan
As mentioned by the person in this link (https://salesforce.stackexchange.com/questions/278239/trying-to-add-related-record-list-to-community), you need the API syntax for the related list. In Lightning, if you go to the Parent record, and then actually click on the Related List to go to the page where you only see the related records, you'll see the API name for the Related List at the end of the URL.  It will contain underscores and end in __r. Something like 'Related_List__r'

The other issue above is that it may not display if there are no related records as seen in the error image above. 
hpask1.391614344211256E12hpask1.391614344211256E12
Use {!recordId} for the Parent Record Id. The Related List name is from the url on the full view of the Related List. Go in Lightning and click on an example of the full list view of your related list and you will see the name at the end of the url. It will probably be FinancialHighlights in this first example. You can see in my example that when I was looking for Files related list on Quotes, I had to use AttachedContentDocuments as my Related List Name.

User-added image
Philip KitzmannPhilip Kitzmann

I tried this and it doesn't work in my Sandbox.

Parent Record ID = {!recordId}
Related List Name = Cases

But "This component has no data" i get. What did i do wrong? 

Shouldn't be so hard to get a list view of the records from the account or?

Curtis Gannaway 9Curtis Gannaway 9
Did you find the answer to this question? I have the same question. 
Matt OkamotoMatt Okamoto
Hi! The answer is Parent Record ID = {!recordId} and Related List Name = Object_Name__r
Carolyn O'Connor 8Carolyn O'Connor 8
I am having the same issue as those above and I do have Parent Record ID = {!recordId} and Related List Name = Cases__r. It is working in Preview Mode, but when I published it I received the following error: Unfortunately, the related list you're trying to view isn't in the layout. Please get in touch with your administrator.

For the record, the Cases Related List is on the partner view layout. I also logged in as someone with active Cases to make sure it wasn't showing this error message only if they had no Cases. Does anyone have any thoughts as to why this might be happening? User-added imageUser-added imageUser-added image
シン キソブシン キソブ

I don't think it is supposed to show any data. Since you're in Builder, it was looking for a specific record Id. In builder, if you want to view how it will work while still in Builder, enter a specific record Id (1000iESdcxsuAAK) under Parent Id and the Related Record Name (Relarionship__r), but you should publish it still with {!recordId}  and {!relationshipApiName}

User-added image

Kerrie Tainter 2Kerrie Tainter 2
OK, so you can find the related list API name by going to the 'child' record. That's the one that actually has the Id of the 'Parent' as a lookup or Master-Detail relationship as one of the fields. If the relationship is a custom relationship created by you, you had the opportunity to choose the name of the child list, and it will end with <...>__r .   If it's a standard relationship, like the one in the picture, you don't need the __r and it will usually have a plural name. Showing the API name of a related list

In the case of the AccountContactRelation junction object, there are two related lists, the first is AccountContactRelations, which appears as a related list on Accounts.The second is the AccountContactRelations which appears as a related list on the Contacts. 

Note that when you are making your own junction objects, there is no rule that says that both related lists have to have the same API name, in fact,  I find it somewhat confusing. But there you go....