Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

I need to get currency symbol in visual force email template. I want it to be the currency the user is using. I check the docs here:

http://www.salesforce.com/us/developer/docs/pages/Content/pages_compref_outputText.htm

But don't see anything that will give to me.

Any tips?

share|improve this question
    
Do you need it as a field formula? –  mast0r Dec 20 '12 at 12:26
add comment

2 Answers

I'm infering from your question that User is the recipient type on your email template. So, how about something utilizing Custom Labels and the ability to access them dynamically, e.g.:

<messaging:emailTemplate subject="Test" recipientType="User" relatedToType="Account">

<messaging:htmlEmailBody >

   <apex:variable var="isoCode" value="Currency{!recipient.CurrencyISOCode}"/>        
   <apex:variable var="currencySymbol" value="{!$Label[isoCode]}"/>

   Your balance is {!currencySymbol}200.00

</messaging:htmlEmailBody>

</messaging:emailTemplate>

Then you can create a Custom Label CurrencyUSD, CurrencyGBP etc. etc.

share|improve this answer
    
I don't know enough about it, so i've added it as a comment but I wondered if Translation Workbench might also provide some options too? –  user293 Dec 20 '12 at 13:32
    
I think he needs an image, not a text –  mast0r Dec 20 '12 at 13:46
    
@mast0r - yeah, i noticed that in your answer...I couldn't see a reference to an image, but i did go out on an Xmas party last night so my eyesight is not at its best :) –  user293 Dec 20 '12 at 13:52
    
For me the party is just tonight :) –  mast0r Dec 20 '12 at 13:54
    
@Phil Hawton first line is <messaging:emailTemplate subject="Daily Digest" recipientType="User" relatedToType="My_Custom_Object__c"> so yes. Howevere your idea gives me: Error: Invalid field CurrencyISOCode for SObject User –  dublintech Dec 20 '12 at 13:57
show 3 more comments

For the visualforce page i would take this one:

<apex:image value="{!CASE(YourObject.CurrencyIsoCode,'EUR','/img/euro.gif',
                                                     'GBP','/img/gbpfund.gif',
                                                           '/img/default.gif')}"/>

Like Mohith say's, here is an example with static resource :)

<apex:image value="{!CASE(YourObject.CurrencyIsoCode,'EUR',URLFOR($Resource.MyRes,'img/eur.gif'),
                                                     'GBP',URLFOR($Resource.MyRes,'img/gbpfund.gif'),
                                                           URLFOR($Resource.MyRes,'img/default.gif'))}"/>

And for the Image field this:

IMAGE(CASE({!YourObject.CurrencyIsoCode}, 'EUR', '/img/euro.gif', 
                                          'GBP', '/img/gbpfund.gif',
                                                 '/img/default.gif'), 'image_label')
share|improve this answer
1  
You may like to show how you can use static resources in your answer :).These images can change in sfdc server without any notice :) –  Mohith Kumar Dec 20 '12 at 13:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.