Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

In Multi-Currency orgs, when a record's Currency is set to a different Currency than the running user's chosen Currency, all Currency fields on that record will be rendered in both the record's Currency AND the running user's Currency, like this:

Currency field

I want to be able to do a single SOQL query to retrieve both of these currency values.

So, say that I have a Currency field Price__c on my object. I want to be able to do something equivalent to the following:

[select Id, Price__c, convertCurrency(Price__c) from MyObject__c]

However, it appears that SOQL only lets you retrieve EITHER Price__c OR convertCurrency(Price__c), but NOT both.

Any ideas on how I could retrieve both without having to do a second SOQL query??

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

As far as I can tell, the only way to get at this data is to have at least 2 SOQL queries: 1 to get the data, and 1 to query either the CurrencyType table (for simple multi-currency orgs) or DatedConversionRate table (for advanced currency management orgs), which both provide conversion rates. Once you get the conversion rates, you have to manually perform the conversions in order to achieve the desired effect.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.