Skip to main content

I have two custom object's that both have links to the standardAccount Object:

- Medication Forms (Each record is a form i.e. medication review form)

- Medication (Each record is a individual medication for the account)

I have a custom button on the Medication Form record that generates a pdf, i have got this to work perfectly however i am having an issue with the showing the Medication as a related list on the form. I have managed to put the related list on the form however it isn't formated in the correct way and doesn't show all the fields required.

My code is so far as follows (i have left the top part of the code out as it isn't relevant and is just text, i have also attempted a few different ways using apex:repeat however i'm not sure i'm getting it quite right):

<apex:page standardController="Medication_Form__c" showHeader="false" sidebar="false" renderAs="pdf">

<apex:relatedList subject="{!Medication_Form__c.Account__c}" list="Medication__r"/>

<apex:repeat var="med" value="{!Medication_Form__c.Account__r}">

<tr>

<td>{!

med.Name

}</td>

</tr>

</apex:repeat>

</apex:page>

2 answers
0/9000