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
Rst123Rst123 

Currency conversion to USD in visualforc​e directly...

Requirement :-

We need to convert the value in column = Total price(USD) in USD (currently its showing user default currency value)

i.e whatever the currency maybe...it should get it convert into USD and display in Visualforcepage

 

<apex:column headerValue="Total Price(USD)">                             

<apex:repeat value="{!varOpp.opp.OpportunityLineItems}" var="PrdLst" rendered="{!if(varOpp.opp.OpportunityLineItems.size>0 , true, false)}" >                                    

<apex:outputText value="{0,Number,currency}"> <apex:param value="{!PrdLst.TotalPrice}" /> </apex:outputText><br/>                                                                                          

 

 

</apex:repeat>                                              

  </apex:column>

 

Now, I want to get the value displayed in PrdLst.TotalPrice in USD currency.

Ashish_SFDCAshish_SFDC
Hi , 

You could try to query the CurrencyType object which contains the conversion rates (In Multi Currency).
The following will give you the conversion rate between your company default currency and the ISO Code contained in the string sISO ('USD' for example)
Double conversionRate = [SELECT conversionrate FROM currencytype WHERE isocode =: sISO LIMIT 1].conversionRate;
Then you'll have to multiply the Amount to convert by the conversion rate to obtain the converted amount.

Or 

OR(
AND( ISPICKVAL (CurrencyIsoCode , "USD"),
ISPICKVAL( Alternative_NST_Type__c , "8k - 8pct"),
Service_Incremental_Discount__c > 8000),
AND( ISPICKVAL (CurrencyIsoCode , "EUR"),
ISPICKVAL( Alternative_NST_Type__c , "8k - 8pct"),
Service_Incremental_Discount__c > 5840),
AND( ISPICKVAL (CurrencyIsoCode , "GBP"),
ISPICKVAL( Alternative_NST_Type__c , "8k - 8pct"),
Service_Incremental_Discount__c > 5160))

You can also use "CASE" instead of nested ISPICKVAL 

Regards
Ashish