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
JJamesJJames 

How to access conversion rate for non-corporate currency in visualforce page

I am wondering if there is an easy way to access the conversion rate from the Manage Currencies page.  We have multicurrency set up and I just want to access the conversion rate decimal.  for example I have a decimal and want to multiply it by the CAD conversion rate.  
Decimal numberToConvert = 100;
numberToConvert=ConversionRate*numberToConvert;

I see in the manage currencies the conversionrate field is .66.  How do I access that field variable in the visualforce page?
Best Answer chosen by JJames
James LoghryJames Loghry
I dont have multi currency enabled on my developer org so I can't confirm this, but there should be a "CurrencyType" object you can query via SOQL.

The SOQL would look something like:
 
Select Id,ConversionRate From CurrencyType Where IsoCode = 'CAD'

More info on the CurrencyType object here: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_currencytype.htm

All Answers

James LoghryJames Loghry
I dont have multi currency enabled on my developer org so I can't confirm this, but there should be a "CurrencyType" object you can query via SOQL.

The SOQL would look something like:
 
Select Id,ConversionRate From CurrencyType Where IsoCode = 'CAD'

More info on the CurrencyType object here: https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_objects_currencytype.htm
This was selected as the best answer
JJamesJJames
Thanks again James!