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.

  • are you having any issues with contacts? because for a particular account record related list name would be contacts i guess. – Mr.Frodo Jul 5 '16 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 Jul 5 '16 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. – Alexander Aeons Torn Jul 5 '16 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 Jul 5 '16 at 17:16
4
<apex:page standardController="Account">
   <apex:relatedList list="AccountContactRelations" subject="{!Account.ID}"/>
</apex:page>

enter image description here

  • Doesn't work for me. 'AccountContactRelations' is not a valid child relationship name for entity Account – Alexander Aeons Torn Jul 5 '16 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 Jul 5 '16 at 21:01

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.