• alertus
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

I want to create a visualforce email template which displays the cost of various support contracts.  Something to the effect of:

 

Total Cost: 10,000.

Basic Package (5%) = $500

Premier Package (10%) = $1000

Contract Expiration Date: 8/1/2010

 

I have fields in our Account object for the total cost and the expiration date.  The basic and premier package costs are calculated by multiplying a percentage (either 5% or 10%) x Total Cost.  

 

Most of the documentation i've seen for the visualforce pages use custom controllers which are defined by <apex:page controller="somecontroller"> syntax.  But, when creating an email template this syntax is different.

 

Here is what i have currently:

 

<messaging:emailTemplate subject="test" recipientType="Contact" relatedToType="Account">
<messaging:plainTextEmailBody >
Account Name: {!relatedTo.Name}</br>
Expiration Date: {!relatedTo.Support_Contract_Expiration__c}<br/>
Total System Cost: {!relatedTo.Support_Contract_Basis__c}<br/>
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 

Using the "__c" I found i was able to access the custom fields in the account object which contain the expiration date and the total cost.

 

Questions:

* Is it possible to do simple multiplication in visual force w/o creating a custom apex component.

* If no, I'm not sure how to create a custom apex class or controller and pass the account details to it in order to then create get methods for the basic cost and premier cost.

 

Could someone point me in the right direction?

 

Thanks in advance.

 

 

 

 

I want to create a visualforce email template which displays the cost of various support contracts.  Something to the effect of:

 

Total Cost: 10,000.

Basic Package (5%) = $500

Premier Package (10%) = $1000

Contract Expiration Date: 8/1/2010

 

I have fields in our Account object for the total cost and the expiration date.  The basic and premier package costs are calculated by multiplying a percentage (either 5% or 10%) x Total Cost.  

 

Most of the documentation i've seen for the visualforce pages use custom controllers which are defined by <apex:page controller="somecontroller"> syntax.  But, when creating an email template this syntax is different.

 

Here is what i have currently:

 

<messaging:emailTemplate subject="test" recipientType="Contact" relatedToType="Account">
<messaging:plainTextEmailBody >
Account Name: {!relatedTo.Name}</br>
Expiration Date: {!relatedTo.Support_Contract_Expiration__c}<br/>
Total System Cost: {!relatedTo.Support_Contract_Basis__c}<br/>
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

 

Using the "__c" I found i was able to access the custom fields in the account object which contain the expiration date and the total cost.

 

Questions:

* Is it possible to do simple multiplication in visual force w/o creating a custom apex component.

* If no, I'm not sure how to create a custom apex class or controller and pass the account details to it in order to then create get methods for the basic cost and premier cost.

 

Could someone point me in the right direction?

 

Thanks in advance.