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

VisualForce Email Template: How to Display Related List Information

what is the error in following code?
<messaging:emailTemplate subject="Eval Request and Request Details" recipientType="User" relatedToType="Trial_Request__c">
<messaging:htmlEmailBody >
<table>
<tr>
<td> Dear Sir </td>
</tr>
<tr>
<td> <dd> Below Eval Request and Eval Requestdetails</dd></td>
</tr>
<tr>
<td> Name : {!relatedTo.Name}</td>
</tr>
<tr>
<td>Customer Name : {!relatedTo.Contact_Name__c}</td>
</tr>
<tr>
<td>status : {!relatedTo.Status__c}</td>
</tr>
<tr>
<td>E-mail Address: {!relatedTo.E_mail_Address__c}</td>
</tr>
</table>
<table border="1">
<tr>
<th> Detail Number </th>
<th> Product Name </th>
<th> Quantity </th>
<th> Remarks </th>
</tr>
<apex:repeat var="itemslist" value="{!relatedTo.Eval_Request_Detail__r}">
<tr>
<td>{!itemslist.Name}</td>
<td>{!itemslist.Product__c}</td>
<td>{!itemslist.Quantity__c}</td>
<td>{!itemslist.Remarks__c}</td>
</tr>
</apex:repeat>
</table>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Related List Fields are normally in the plural - check the relationship name.
<apex:repeat var="itemslist" value="{!relatedTo.Eval_Request_Detail__r}">
should probably read
<apex:repeat var="itemslist" value="{!relatedTo.Eval_Request_DETAILS__r}"> (i.e. Plural s)
sorry not working. same error occur
Hey,
Check the exact child relationship name. Sometimes it varies and is not the name of the related object, maybe some other name has been given!!
Check in the field details of lookup/child field in the master object.
Hope this helps!