+ Start a Discussion
Linda 98Linda 98 

Visulaforce email template HELP!!!

Hi

I am having a custom object as master object and a child object.which is similar to opportunity and opportunity products.(custom master object,custom child object)
I am using them in Visualforce email template.
But i am not able to get that.
I want to show line items of custom child object when i send email
here is my code.How can i call line items on This template.
Please help me where i am going wrong
<messaging:emailTemplate subject="customobjectlineitems: {!relatedto.Name}" 
        recipientType="User" 
        relatedToType="master custom object (LIKE OPPORTUNITY)">

<messaging:htmlEmailBody >        
    <html>
        <body>
         
         <font face="arial" size="2">
         <p>List of products related to the Custom master object:<b> {!relatedTo.name}</b>.</p>  
         <p/>                  
         <table border="0" >
           <tr> 
            <th>Name</th>
             <th>Unit Price</th>
               <th>Total Price</th>
           </tr>
           <apex:repeat var="co" value="{!relatedTo.child custom object (LIKE OPPORTUNITYLINEITEMS)}">

//ERROR HERE  because i am using line items wrong here NOt sure how can i.

               <tr>
               <td>{!co.Name)}</td>
               <td>{!(co.UnitPrice)}</td>
               <td>{!(co.TotalPrice)}</td>
               </tr>
           </apex:repeat>                 
         </table>
       <p/>
     </font>
    </body>
    </html>
</messaging:htmlEmailBody> 
       
</messaging:emailTemplate>



 
JeffStevensJeffStevens
On line #18 - are you using the PLURAL of the relatedTo.child?  Might help to see the real code on #18, and #3
Linda 98Linda 98
As it is a custom object,i am using it as it is. Like Custom_object__c