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
Saranya TharaniSaranya Tharani 

To access Salesforce Standard Rate Conversion table

Hello,

I am looking for a Solution  to convert one currency to another bewteen two records from two different Custom Objects. I am not using DatedExchange rates here. I want to access the Salesforce Standard Conversion rate Table where we will be updating the Currencies and their conversion rates manually.  Is there an API name to get the std Conversion Rate Table like "DatedConversionRate" for Dated Exchange Rates? 
I need to refer that and include the logic to convert one currency value to another.

Any suugestions to this would be great.  Thanks in Advance!!! 

-Sara
Prateek Singh SengarPrateek Singh Sengar
Hi Sara,
Few things to note about DatedConversionRate:
  • Its only available if advanced currency management is enabled. 
  • Its the coversion rate with respect to your corporate currency. In your use case where you want to covert currency A stored in object 1 to Currency B might not be the right use case.
  • DatedConversionRate does not support DML however you can query the information using SOQL. You can then use the values from DatedConversionRate table and apply the coversion logic in your custom code.
SELECT Id, IsoCode, ConversionRate, StartDate, NextStartDate FROM DatedConversionRate ORDER BY NextStartDate DESC

 
Felix van Hove 22Felix van Hove 22
Hello,

Not sure, if this would have been the best way to meet the original requirement, but there is obviously the table CurrencyType, e.g.

SELECT Id, IsoCode, IsCorporate, IsActive, ConversionRate
FROM CurrencyType

This does not require advanced currency management.