0

I created a custom page that I want to show the related list between my Opportunity Object, and a Custom Object (DocuSign)

I have not been able to insert the proper relationship name, and I get the error:

'XXXXX' is not a valid child relationship name for entity Opportunity

I went into the Custom Object, click on the field that is related to the opportunity, and on the Child Relationship name I found this: enter image description here

This kind of looks like an Id.

My code looks like this:

<apex:relatedList list="R00N80000002fD9vEAE" title="Opportunity DocuSign Status">
        <apex:facet name="header">Opportunity DocuSign Status</apex:facet>
      </apex:relatedList>

I have tried adding __r at the end of the field Id/name, but still no luck.

  • Adrian's answer makes sense - you're likely missing the namespace of the child relationship. You should be able to see the namespace on the child object and prepend it to the child relationship name in your related list (probably something like docusign__R00N80000002fD9vEAE) – Instread Aug 20 at 19:53
1

You can get the fully qualified API Name of the Child Relationship (including any namepace if applicable) using the following script:

for (ChildRelationship relation : SObjectType.Opportunity.getChildRelationships())
    system.debug(relation);

Filter the results to look for your specific child object. Likely it has a namespace prefix which you were missing.

| improve this answer | |
  • Hey! Sorry I can't upvote, but this did the trick. Not sure why the name was not the same as the one that appeared in the reference page. – Neto0291 Aug 21 at 2:38
  • You can still accept the answer to indicate that this approach resolved your issue. – Adrian Larson Aug 21 at 3:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.