I want to display all the Accounts that have same contacts in them. Suppose Account 'A' has 5 contacts associated to it lets say c1,c2,c3,c4 and c5. Now on contact page i want to see a related list where all other related contacts can be displayed. Means if I open contacts page of c1 then i want a related list showing entries like c2,c3,c4 and c5.
For this I was thinking to use SOQL and then populate the related list using apex. The SOQL query returns all the name of contacts that are related.
List<Contact> acid=[SELECT Id, AccountId, Name, Related_Contacts__c
FROM Contact
WHERE AccountId = : cnt.AccountId];