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
EPSWDEVEPSWDEV 

Constructing a VS page with custom object details selected at run time

Hi, I am trying to create a Visual source page which as two sections - Sec1 and Sec2. Sec1 display's the detail of lets say CustomObj1.
CustomObj1.field1 is a picklist  of different custom objects and depending on the value chosen, I want  the second section to display details of custom object chosen. for eg is Accounts was chosen display account detail feilds, if contact then contact detail.

whats the best way to do this?

I am implementing a component for sec2 that takes in the custom object type selected then dispaying the detail for that object however i find that I cannot specify object to a <apex:detail> tag. what are my options here.

thanks,
aalbertaalbert
Check out the Force.com Developer Guide available as PDF online here
Chapter 12 has examples and code walkthroughs on setting up dynamic picklist values and dynamic displaying of data. I think this is a great place to start.




JimRaeJimRae
Since you need to pass the ID of the object you want to display the details of in the detail tag, you should not have a problem.
Your selectlist in section one will need to rerender the section that the detail tag is in, and you will need to capture the value of the picklist selected, and pass that as the subject of the detail tag.