You need to sign in to do that
Don't have an account?
Wilksy
VisualForce email template using Apex:repeat
Hi
There's an example here to create a VisualForce email template:
How would I go about changing this code so that there is a 'where' clause on the cases that are returned in the apex:repeat list?
<apex:repeat var="cx" value="{!relatedTo.Cases}"> <tr> <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> | <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td> <td>{!cx.CaseNumber}</td> <td>{!cx.Subject}</td> <td>{!cx.Contact.email}</td> <td>{!cx.Status}</td> </tr>
</apex:repeat>
Great - works first time.
Simple solution.
All Answers
You can try to use a output panel with a rendered part.
<apex:repeat var="cx" value="{!relatedTo.Cases}"> <apex:outputPanel rendered="Your Condition"> <tr> <td><a href="https://na1.salesforce.com/{!cx.id}">View</a> | <a href="https://na1.salesforce.com/{!cx.id}/e">Edit</a></td> <td>{!cx.CaseNumber}</td> <td>{!cx.Subject}</td> <td>{!cx.Contact.email}</td> <td>{!cx.Status}</td> </tr> </apex:outputPanel> </apex:repeat>
Great - works first time.
Simple solution.
Help a newbie - what was the format for "Your Condition:"?
Found it - should have queried a bit more before asking.
For example: <apex:outputPanel rendered="{!cx.Status = 'Open'}">
I am trying to modify this to use Cases and the related Parts which is a custom object.
When I change the line
to
I get the error:Invalid field parts__c for SObject Case.
Any ideas what I am doing wrong???
Thanks for any help
Elly
Hi
Try
<apex:repeat var="cx" value="{!relatedTo.Parts__r}">
Thank you SO much!!! Didn't think of that - DUH!