+ Start a Discussion
mike83mike83 

Page to Consume Multiple Objects

Ok so I am totally new to this and need some help.  I have an APEX page with that uses a custom Object and a standard Controller. Like this:
<apex:page standardController="Rep_Page__c" showheader="false">
I get a field from that object like this
<p>{!Rep_Page__c.Welcome_Message__c}</p>

Rep_Page_c has a look up field: {!Rep_Page__c.Sales_Library_Item_1__c}
this does a lookup on another custom object named sales_library which is basically a listing
of articles with fields for headlines teasers content and other stuff I want to pull that
data into the page as well through that lookup. Do I need to build a custom class for that?

Basically I dont know how to call the data from that object onto the same page where a standard
controler is delared for another object. It seems like there should be an easy way to do this
since the two objects are related via that lookup but I dont know what that is. Any help would
be greatly appreciated even just a kick in the right direction.

MPIMPI
Add __r instead of __c to "dereference" an object.

So in your case you could use:

{!Rep_Page__c.Sales_Library_Item_1__r.Some_Object__r.Headline}