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
emandra_kfemandra_kf 

Child to Parent relational query in a "New" Visualforce page

I am attempting to access parent data fields from a child object in a Visualforce page used to create new records in the child object.

 

I have a similar detail page for viewing records in the child object, and on that page I can simply access parent data with the apex component:

<apex:outputfield value="{!child_object__c.parent_object__r.fieldname}".

 

However, with the "new" page, the same approach just comes back null. Do I need to create a controler extension instead? I'm lost and not sure what the right approach might be.