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
JN22JN22 

Cross-Object Related List in VF Page

Hello,

 

I have a custom object that has a Master-Detail relationship with the Account object.  I have a VF page that gets created using this custom object as the controller.  I would like to be able to list out in this VF page any open Opportunities that are associated with the same Master Account as my custom object record.  Is this possible and if so, can someone point me to somewhere that explains it?  Thanks.

HusseyHussey

Yes, this is possible. If you have the Id of the Account record, you can get its related records from any object to which Account is a parent object. As per your post you are using Custom object as Standard controller, from that you can get Account record Id(Parent of the current record) , then you can use this Account record Id for queryng any of its related records.