2

With Contacts related to multiple Accounts I tried to modify my view of Account. Till now we were using this visualforce page.

<apex:page standardController="Account" extensions="AccountViewController">
    <apex:pageMessages id="messages"></apex:pageMessages>
    <apex:detail relatedList="false" showChatter="false" inlineEdit="true"/>
    <apex:relatedList list="Contacts"/>
    <div><c:CustomRelatedListsComponent /></div>
    <apex:relatedList list="AccountCampaignMembers__r"/>
    <apex:relatedList list="OpenActivities"/>
    <apex:relatedList list="ActivityHistories"/>  
    <apex:relatedList list="SavingAnalyses__r"/>
    <apex:relatedList list="Opportunities"/>
    <apex:relatedList list="Peers__r" rendered="{!isLeadAccount}"/>
    <div><c:CustomAccountHistory /></div>
    <div><c:CustomDuplicatesAccount /></div>
</apex:page>

I would like to substitute Contacts for the related contacts. But I tried multiple combination of names and still doesn't work. Of course I searched thorugh Salesforce help but couldn't finde nothing. Does someone know first if this is possible and if it is the name of the related list?

AccountContactRelationships

AccountContactsRelationships

ContactsRelated

RelatedContacts

And some other more than even made less sense are the ones I tried.

4
  • are you having any issues with contacts? because for a particular account record related list name would be contacts i guess.
    – Mr.Frodo
    Commented Jul 5, 2016 at 16:54
  • Did you try Related_Contacts? Look at the lookup field that relates to the account and use theChild Relationship Name listed there
    – Eric
    Commented Jul 5, 2016 at 16:56
  • Contacts works perfectly. I didn't try underscore since on standard relationships isn't used( at least i thoght that) but i'll try and tell you if it worked. Commented Jul 5, 2016 at 17:02
  • @AlexanderAeonsTorn - Sorry was a bit confused. You already had contacts as the related list in your question. I thought you were talking about a custom lookup you named related contacts.
    – Eric
    Commented Jul 5, 2016 at 17:16

1 Answer 1

4
<apex:page standardController="Account">
   <apex:relatedList list="AccountContactRelations" subject="{!Account.ID}"/>
</apex:page>

enter image description here

2
  • Doesn't work for me. 'AccountContactRelations' is not a valid child relationship name for entity Account Commented Jul 5, 2016 at 20:36
  • 1
    @AlexanderAeonsTorn: hmm - works for me; have you enabled the Account setting that supports one Contact w/ many Accounts? Is your VF page at V37.0?
    – cropredy
    Commented Jul 5, 2016 at 21:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .