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

Currency getting converted into Organization default currency while using aggregate SOQL

Hi All,

I'm my code I have a aggregate SOQL on currecny field, which always provides me the result in Organization default currecny(in USD). After some reaching I found there is a manual way to solve the issue ( ). In my application there are many places where we are having this issue.

So, is it possible to use "convertCurrency" function to restrict the conversion to org default?

Hi Upendra,

The convertCurrency() in the SELECT statement of a SOQL query is used to convert currency fields to the user’s currency. You cannot convert the result of an aggregate function into the user’s currency by calling the convertCurrency() function.

If a query includes a GROUP BY or HAVING clause, currency data returned by using an aggregate function, such as SUM() orMAX(), is in the org’s default currency.

You can refer to the following document

Please do let me know if you need any further clarification. If you feel that your question was answered then do flag the appropriate answer as the solution to your query.

Kind Regards,

Hi Swarna,

Thanks for making some time and replying to this post.

Actually I have already went through the document, but it's very confusing. 

My issue is: The field has stored currency values as EUR, while using aggregate query to get sum of the currecny amount I'm expecting it to be in EUR but Salesforce automatically converts it to USD(Our corporate currecny) which I don't want.

So, how I can block it? or any easiest way to get the amount in EUR instead of USD?