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
dkndkn 

render as pdf

have an contact object and an academic schedules object.
Contact object and academic schedules object are in a master-detail relationship, where master is contact and detail is academic schedules.So, One contact can have more than one detail record(Academic schedules) associated with it.I need to generate a pdf document , so that it captures the values from the contact record and as well as the individual field values from each detail record. Say , supposes, I have A, B, C, D as detail records. Then I might have 1, 2 ,3 ,4 , 5 as field names and these are the fields available on Record A, Record B etc,.
I want to capture Record A with 1 and 4 field value apart from capturing the contact record field values(which is very easy.).How can I do this , Is there way to pull invididual field values when in an master detail relationship.I would really appreciate any reply

 

thank you

Best Answer chosen by Admin (Salesforce Developers) 
mtbclimbermtbclimber

If I understand you correctly this might help you get started:

 

 

<apex:page standardController="Contact">
<apex:outputField value="{!contact.name}"/>
<apex:repeat value="{!contact.academic_schedule_items__r}" var="item">
<apex:outputField value="{!item.name}"/>
</apex:repeat>
</apex:page>

 

"academic_schedule_items__r" is the child relationship name as you'd see on the field definition page for the master-detail relationship field on the academic schedule pointing to contact.

 

 

All Answers

mtbclimbermtbclimber

If I understand you correctly this might help you get started:

 

 

<apex:page standardController="Contact">
<apex:outputField value="{!contact.name}"/>
<apex:repeat value="{!contact.academic_schedule_items__r}" var="item">
<apex:outputField value="{!item.name}"/>
</apex:repeat>
</apex:page>

 

"academic_schedule_items__r" is the child relationship name as you'd see on the field definition page for the master-detail relationship field on the academic schedule pointing to contact.

 

 

This was selected as the best answer
dkndkn

Thank you thank you so much .........I am done with this.

 

dkndkn

Hi Andrew,

I have another issue , can i render the child of academic_schedule_items__r ?

 

thank you