• Gina Szafraniec 13
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Here is my code. I can not even save this because the related object is not being located. 
I'm trying to generate a list of related payments for an Opportunity. (not sure if it matters, but our org renamed Opportunities to Income)...what's going on? I keep getting this message: "Error: Invalid field OppPayments for SObject Opportunity"
 
<messaging:emailTemplate 
recipientType="Contact" 
relatedToType="Opportunity"
subject="Payment report for Opportunity: {!relatedTo.name}"
replyTo="n.wylder@ifiusa.org">
    <messaging:htmlEmailBody>
        <html>
            <body>

            <p>Dear {!recipient.name},</p>
            <p>Below is a list of payments related to {!relatedTo.name}.</p>
            <table border="0" >
                <tr>
                    <th>Case Number</th><th>Origin</th>
                    <th>Creator Email</th>
                </tr>
                <apex:repeat var="cx" value="{!relatedTo.OppPayments}">
                <tr>
                    <td><a href = 
                        "https://na77.salesforce.com/{!cx.id}">{!cx.Name}
                    </a></td>
                    <td>{!cx.Designation__c}</td>
                    <td>{!cx.npe01__Payment_Amount__c}</td>
                </tr>
                </apex:repeat> 
            </table>
            <p/>
            <center>
                <apex:outputLink value="http://www.salesforce.com">
                    For more detailed information login to Salesforce.com
                </apex:outputLink>
            </center>
            </body>
        </html>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>