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
Ben.SchauerhamerBen.Schauerhamer 

How can I display SOQL parent relationship field on a VisualForce page?

Pardon the "newbie" question.

I am querying a custom object and would like to display the owner name on a VisualForce page with the list of objects that meet the criteria. The Apex Code that I am running is:
<pre>
public List<CustomObject__c> getCustomObject() {
  List<CustomObject__c> customObject = [SELECT Name, Owner.Name, FROM Custom_Object__c];
  return customObject;
</pre>

The VF Code I am using is
<pre>
<apex:repeat var="object" value="{!customObject}">
  {!object.Owner.Name}
</apex:repeat>

Any help would be greatly appreciated.
Best Answer chosen by Ben.Schauerhamer
Ben.SchauerhamerBen.Schauerhamer
I actually just figured it out myself. All I had to do was change the Apex to be 
<pre>
<apex:repeat var="object" value="{!customObject}">  
  {!object.OwnerName}
</apex:repeat>
</pre>