• Bshardi
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 10
    Replies

I'm still new to visualforce and apex but I'm trying to figure out how to calculate the sum of fields in an visualforce email template.

 

I am making a receipt that can be emailed and I want to sum the total of payments made. I'm using an app called pervasive integrated credit card processor. The payments object's parent is Accounts. The visual force template is under Opportunities. 

 

It would be nice if I could do a simple roll-up summary field on the opportunity to sum the payments and then pull the amount but since payments is a child of accounts it does not allow me to do this. 

 

So, saying all that I just need to sum the payments where the opportunity ID is the ID of the current opportunity being used. 

 

How would I code this? Is there an easier way?

I'm creating a visualforce email template but I am having a hard time accessing fields from a parent object. Currently I have the visualforce template related to the Opportunity object. I would like to access the Account name on the opportunity. How would I do this? Any example?

I'm still new to visualforce and apex but I'm trying to figure out how to calculate the sum of fields in an visualforce email template.

 

I am making a receipt that can be emailed and I want to sum the total of payments made. I'm using an app called pervasive integrated credit card processor. The payments object's parent is Accounts. The visual force template is under Opportunities. 

 

It would be nice if I could do a simple roll-up summary field on the opportunity to sum the payments and then pull the amount but since payments is a child of accounts it does not allow me to do this. 

 

So, saying all that I just need to sum the payments where the opportunity ID is the ID of the current opportunity being used. 

 

How would I code this? Is there an easier way?

I'm creating a visualforce email template but I am having a hard time accessing fields from a parent object. Currently I have the visualforce template related to the Opportunity object. I would like to access the Account name on the opportunity. How would I do this? Any example?

I've created a visualforce email template that has an attachment on it. It works really well when I click Send an Email, choose the contact, then choose the Template. However, I've created a custom link on the object that says Email. I want it to open up the email and automatically fill in the contact and the template. That way the user can change the body before sending it. When I click on the button it fills in the body from the template but there's no attachment! If I then select the template again, the attachment shows up.

 

There are merge fields from the RelatedTo and the Recipient in the body of the template which are working, so I don't know what is wrong.

 

Here's the link which passes the Contact, Quote ID, and Template ID to the Send Email page:

 

/_ui/core/email/author/EmailAuthor?p3_lkid={!Quote__c.Id}&retURL=%2F{!Quote__c.Id}&p2_lkid={!Quote__c.ContactId__c}&template_id=00XA0000000QX8G

 And here's the template that it's using:

 

<messaging:emailTemplate subject="{!relatedTo.Type__c} {!relatedTo.Name} for {!recipient.Account.Name}" recipientType="Contact" relatedToType="Quote__c"> <messaging:plainTextEmailBody > Dear {!recipient.FirstName} {!recipient.LastName}, I have attached the {!relatedTo.Type__c}, as we discussed. Please call me if you have any questions. Sincerely, {!$User.FirstName} {!$User.LastName} {!$User.Phone} </messaging:plainTextEmailBody> <messaging:attachment renderAs="PDF" filename="{!relatedTo.Type__c} {!relatedTo.Name} for {!recipient.Account.Name}"> <c:quote quoteId="{!relatedTo.Id}"/> </messaging:attachment> </messaging:emailTemplate>