Skip to main content
Saranya Tharani (NTT Data) a posé une question dans #Apex
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
2 réponses
  1. 23 août 2016, 15:04
    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