You need to sign in to do that
Don't have an account?

Reference fields of Master Object in a VisualForce Page
Hi,
I have created a custom object called "Procedures" which is having Master-Detail relationship with standard object "Contact"
I am trying to create a VisualForce page to print a PDF report on "Procedures". In this PDF, I need to display the Name & Address of the "Contact"
How do I reference the fields of the master object "Contact" ? I tried the following but it is not working.
<apex:OutputField value="{!Procedures__c.Contact__r.Name}"/>
Any pointers will be highly appreciated.
Thanks & Regards,
Hi,
I was able to resolve the problem. I was not referencing it using the correct name. The field that I created was "Patient's Name" and hence it should be referenced as
<apex:OutputField value="{!Procedures__c.Patient_s_Name__r.Name}"/>
Anyways, thanks Prasanna for taking out time to look into this and respond.
Regards,
All Answers
Are you using the standard controller for this? You will need to write extension and make query for values of those fields.
--Prasanna
Hi,
I was able to resolve the problem. I was not referencing it using the correct name. The field that I created was "Patient's Name" and hence it should be referenced as
<apex:OutputField value="{!Procedures__c.Patient_s_Name__r.Name}"/>
Anyways, thanks Prasanna for taking out time to look into this and respond.
Regards,