Skip to content
This repository has been archived by the owner on Jan 27, 2024. It is now read-only.

Unable to display custom object in Child Relationships #13

Closed
steinstv opened this issue Jan 3, 2018 · 10 comments
Closed

Unable to display custom object in Child Relationships #13

steinstv opened this issue Jan 3, 2018 · 10 comments
Assignees
Labels
discussion 💬 Discussing usage, best practices, questions, etc.

Comments

@steinstv
Copy link

steinstv commented Jan 3, 2018

Awesome component Doug! I don't know if my issue is a bug or just "operator error" but I'm not able to display a custom object in the Child Relationships list. I installed your component and added to the Account page layout. My object name is Fund__c and it has a field called ExternalManager__c that is a lookup to Account. The relationship name is FundToAccount... but when I add FundToAccount to the comma separated list in Child Relationships, the component errors out when I load the Account page.

Thanks in advance for any suggestions!
Steve

<fields> <fullName>ExternalManager__c</fullName> <deleteConstraint>SetNull</deleteConstraint> <externalId>false</externalId> <label>Account Name</label> <referenceTo>Account</referenceTo> <relationshipLabel>Funds</relationshipLabel> <relationshipName>FundToAccount</relationshipName> <required>false</required> <trackHistory>true</trackHistory> <trackTrending>false</trackTrending> <type>Lookup</type> </fields>

@steinstv
Copy link
Author

steinstv commented Jan 3, 2018

Disregard... embarrassingly simple fix... just add "__r" to the custom relationship name!

@steinstv steinstv closed this as completed Jan 3, 2018
@douglascayers douglascayers added the discussion 💬 Discussing usage, best practices, questions, etc. label Jan 3, 2018
@douglascayers
Copy link
Owner

Hi @steinstv,

Glad you like the component, thanks for the feedback!

Those custom relationship fields are tricky. Glad you figured it out; have to include the __r to the relationship name. It would be nice if Salesforce UI displayed the suffix. Many people get stung by that.

Hrm.... maybe I can try to infer if a relationship by the entered text exists if all its missing is the __r suffix 🧐

@JulianneNashSmith
Copy link

Hi @douglascayers , great app. I also had this issue until I found this thread. I think all you need to do is update the wording of the last paragraph under the title "How do I customize which related lists are shown in the vertical navigation?" to clarify that you need to add the __r suffix. I was following those instructions, and was copying the exact value in the child relationship name field because the documentation didn't actually say to add the __r suffix (although I see it's there in the example in the previous paragraph.

@douglascayers
Copy link
Owner

Thanks @JulianneNashSmith, I've updated the instructions hopefully clarifying about when to need the __r suffix and linking back to this issue.

@JodieM
Copy link

JodieM commented Sep 19, 2018

Can you please add a comment for using relationships for Managed Packages to include the Namespace also. Eg

dsfs__DocuSign_Envelopes__r

@rashafaa
Copy link

Hello,

I see a comment above about a managed package. Do I need to be doing anything differently when trying to view a relationship with a manged package?

My child relationship n ame is Policys, so i'm inputting Policys__r and can't pull up the list. Would love your thoughts. Thanks!

@agrau84
Copy link

agrau84 commented May 15, 2019

Love this component! Quick question for you: does this only work in master-detail relationships, or can I also include lookup relationships? I've been attempting to make this work for custom objects that have a lookup field to the account but I'm not sure if I'm doing it incorrectly or if it's not supported.

Thanks so much!

**Cancel that - I answered my own question!

With a lookup relationship, I went to the field that looks up to the account and used the "Related List Label", adding in underscores between each word and appending it with __r.

What I noticed did not work was a related list label that had parenthesis. I removed them and was able to save the details in the Child Relationships section on the Lightning page editor.

Now the component displays these objects with a count of how many files, but those custom objects with lookup relationships to the account are not actually displaying the files or the count of them.

Are these types of relationships supported?

@douglascayers douglascayers self-assigned this May 16, 2019
@douglascayers
Copy link
Owner

Hi @agrau84, I'm glad you figured out how to specify the child relationship name. For the other question you brought up, would you mind opening a new issue with screen shots demonstrating what you mean by:

Now the component displays these objects with a count of how many files, but those custom objects with lookup relationships to the account are not actually displaying the files or the count of them.

Thanks

@LeoFlo1
Copy link

LeoFlo1 commented Mar 25, 2020

I'm unable to see contacts. I have a custom object (service__c) that references contacts as a lookup (vendor__c), but i'm unable to see it as a related record on the related files list.

@katkati
Copy link

katkati commented Feb 21, 2023

I'm using the component on one of my custom object layouts. This custom object has lookup with account, contact, oppty and leads. The child relationship name is "Documents", under the child relationships, i added Documents__r.

I keep getting the error:- "Sorry, error initializing component Cannot read properties of undefined (reading 'objectName')"
Has anyone resolved this issue? Would love to know how to tackle this.
TIA

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion 💬 Discussing usage, best practices, questions, etc.
Projects
None yet
Development

No branches or pull requests

8 participants