You need to sign in to do that
Don't have an account?
Issue with Aggergate query summing in USD for CAD opportunity
Hi I have an issue in code with Aggregate query.
I have an object Deal Summary which sums up fields in Opportunity products and displays as related list in opportunity.
This is done by an after update trigger on oppportunity. But here if the currency of an Opportunity product is CAD, It shows up the deal Summary in USD; because the aggregate query is aggregating everything in USD.
Here is my trigger
Trigger SGSFA_NA_UPDATE_DEAL_SUMMARY on Opportunity (After Update) {
Please help. I am stuck here. How do aggregate in Canadian Dollars. |
Unfortunately, you can't:
"If a query includes aGROUP BYorHAVINGclause, any currency data returned by using an aggregate function, such asSUM()orMAX(), is in the organization's default currency. You cannot convert the result of an aggregate function into the user's currency by calling theconvertCurrency()function."
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_soql_querying_currency_fields.htm