You need to sign in to do that
Don't have an account?
![Chris Traver Chris Traver](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
Help with Apex Repeat for Custom Orders Object
Help with Apex Repeat for Custom Orders Object
Hello,
New to Visualforce and creating an email template for orders that have shipped. I'm unable to get the line to repeat if there are multiple items on the same PO #.
Can someone tell me what I'm doing wrong, I keep trying different things and have not been successful.
<messaging:emailTemplate recipientType="Contact"
relatedToType="Ordered__c"
subject="Your Order Has Shipped PO # {!RelatedTo.Name}"
replyTo="example@example.com">
<messaging:htmlEmailBody >
<html>
<body>
<STYLE type="text/css">
TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center }
TD {font-size: 11px; font-face: verdana }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #CCCCCC; border-width: 1}
</STYLE>
<font face="arial" size="2">
<p> Your order or a portion of your order has shipped. Below shows tracking for each ordered line item</p>
<p> Order #: {!relatedTo.Name}</p>
<table>
<tr>
<th>Action</th>
<th>QTY</th>
<th>Part</th>
<th>Description</th>
<th>Tracking</th>
<th>Freight Co</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.id}">
<tr>
<td><a href="https://na1.salesforce.com/{!relatedto.id}">View</a> |
<a href="https://na1.salesforce.com/{!relatedto.id}/e">Edit</a></td>
<td>{!cx.QTY__c}</td>
<td>{!cx.Part__c}</td>
<td>{!cx.Description2__c}</td>
<td>{!cx.Tracking_Number__c}</td>
<td>{!cx.Freight_CO__c}</td>
</tr>
</apex:repeat>
</table>
<p> For more information, login to http://www.salesforce.com</p>
</font>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Hello,
New to Visualforce and creating an email template for orders that have shipped. I'm unable to get the line to repeat if there are multiple items on the same PO #.
Can someone tell me what I'm doing wrong, I keep trying different things and have not been successful.
<messaging:emailTemplate recipientType="Contact"
relatedToType="Ordered__c"
subject="Your Order Has Shipped PO # {!RelatedTo.Name}"
replyTo="example@example.com">
<messaging:htmlEmailBody >
<html>
<body>
<STYLE type="text/css">
TH {font-size: 11px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center }
TD {font-size: 11px; font-face: verdana }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #CCCCCC; border-width: 1}
</STYLE>
<font face="arial" size="2">
<p> Your order or a portion of your order has shipped. Below shows tracking for each ordered line item</p>
<p> Order #: {!relatedTo.Name}</p>
<table>
<tr>
<th>Action</th>
<th>QTY</th>
<th>Part</th>
<th>Description</th>
<th>Tracking</th>
<th>Freight Co</th>
</tr>
<apex:repeat var="cx" value="{!relatedTo.id}">
<tr>
<td><a href="https://na1.salesforce.com/{!relatedto.id}">View</a> |
<a href="https://na1.salesforce.com/{!relatedto.id}/e">Edit</a></td>
<td>{!cx.QTY__c}</td>
<td>{!cx.Part__c}</td>
<td>{!cx.Description2__c}</td>
<td>{!cx.Tracking_Number__c}</td>
<td>{!cx.Freight_CO__c}</td>
</tr>
</apex:repeat>
</table>
<p> For more information, login to http://www.salesforce.com</p>
</font>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
You can find more info here: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm (https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_repeat.htm" target="_blank)