function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RLBJaynesRLBJaynes 

Trying to create a table of "second degree of separation" objects on a VF page

Our company has this idea of "networks" of accounts - similarly to how linked in shows you networks of connections.

 

I'm trying to create a page, or link to a page, which shows all of the "second degree" connections to the account whose page you're currently on.

 

I've created a custom object Network__c that has a master-detail relationship to Main_Dealer__c (account) and a lookup relationship to Network_Member__c (account)

 

Given the relationship below, I need a page/report/table which would display that Account A and Account C are related by a "second degree of separation"

 

Network 1 = Account A (master-detail), Account B (lookup)

Network 2 = Account B (master-detail), Account C (lookup)

 

caveat: I can change anything about the custom Network__c object in order to make this work properly.

 

Any thoughts and/or controller and page code you could provide would be wonderful

 

Sandeep001Sandeep001

You can create a VF page that can be opened from a link/button on both Main Dealer & Network Member detail page. In your custom controller, you need to query related records of Main dealer/Network member (you need to pass SFDC id to your VF page) in Network__c table.

RLBJaynesRLBJaynes

Could you expand on this? Maybe provide some controller and page code examples, please?