function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
FadiShamiFadiShami 

Hiding the default currency in a Multi-Currency org when displaying using outputfield

I have a multi-currency enabled org. Using the VF outfield tag , we are displaying a currency on Sites - The default currency of the the guest user is set of EUR- but the pricelist that applies to this usecase is in  CHF (Swiss Franc) , So the price is displayed as in this format  "CHF 308.00 (EUR 308.00)" - 

 

Is there a way to hide the EUR portion of the price, and just display the price in CHF?

 

Note that, I do not want to use outputText as i want to take advantage of the currency formatting provided by outputField tag...

 

Thanks

 

Best Answer chosen by Admin (Salesforce Developers) 
meerameera

Hi All,

 

I also had the same issue of defaulting currency type to user currency in visualforce page, even if the object's currency is different.

 

This issue got resolved by: when I am querying for the record, query "currencyISOCode" also. Then in the VF page currency amount will be displayed in record's currency and in bracket you can see user's currency. Hope this info will be helpful.

All Answers

SteveBowerSteveBower

Not sure about what to do if you're using an outputField.

 

Could you use outputText and format the currency using the MessageFormat extensions?

 

<apex:outputField .... value="{!myValue,number, currency}" .... >

 

-S

FadiShamiFadiShami

so the syntax would be

 

<apex:outputText  value="{!sobject.price, number,currency}" />    ?

SteveBowerSteveBower

My apologies, I was moving fast.... the actual syntax would be:

 

 

        <apex:outputText value="{0,number,currency}">
        	<apex:param value="{!Account.AnnualRevenue}"/>
        </apex:outputText>

 

Best, Steve.

 

FadiShamiFadiShami

Hey, thanks for the suggestion - I tried it but it displayed the price as $ 308.00 - it ignored the currency of the price on the object- pretty weird behavior !!

SteveBowerSteveBower

I'm not sure which value would be displayed... however, remember that both the object has a default currency, and you as a user have a currency.  My guess would be that it's giving you the one for you, the user, regardless of the object's currency.  So, I suppose you could query the object's currency and do the conversion yourself and display the object you want regardless of your currency.

 

Best, Steve.

meerameera

Hi All,

 

I also had the same issue of defaulting currency type to user currency in visualforce page, even if the object's currency is different.

 

This issue got resolved by: when I am querying for the record, query "currencyISOCode" also. Then in the VF page currency amount will be displayed in record's currency and in bracket you can see user's currency. Hope this info will be helpful.

This was selected as the best answer
Radhika MRadhika M

Hi Meera,

 

     Thanks for ur Information.But only the problem is,If I select any currency in record ( like INR,AUD,EUR,GBP.......),It displays as $ format like $500.00 .It doesnt display the record's currency.eventhough I am querying "  CurrencyIsoCode  ".

 

Can u give any solution for this plz....

 

 

 

Thanks In Advance..........

Stéphane CLARETStéphane CLARET
Hi all,

I'm having the same issue. Can I recactive this old topic or shoud I open a new one?

Thanks!