I’m building a chart based on an aggregate of a currency field, showing a total currency amount across some rows that have been grouped by type.
Unfortunately, all the figures are wrong. They don’t add up with the currency amounts displayed for the rows in a table.
It turns out that Salesforce has a “feature” that when you do an aggregate query on a currency field in a multicurrency org, the aggregated currency field is returned in the org’s default currency, instead of the user’s currency.
https://developer.salesforce.com/forums/?id=906F00000008y4vIAA
There is a solution in the discussion above that involves querying the conversion rate yourself and applying it. I would do that if I was working in Apex, but can I do the same thing in a Skuid page? I suspect it would delay displaying the dashboard if I did it client-side.
Would it be possible for you to do this conversion server-side and return an extra field in the aggregate model with the aggregated currency fields in the user’s currency?
Alternatives:
- Write this custom query and include it in Skuid as a REST API model.
- Or maybe you can directly query the users currency and the currency conversion rate (I really don’t know if that is accessible). And then do a UI Only field in your aggregate to lookup the conversion rate in the second model and do the rate calculation.
Ideas, just ideas.
Thanks Rob, those are good thoughts and if I find a work-around I’ll post it back here.
I wonder how much of a niche case this is, aggregate dashboards for currency fields in a multi-currency org? If it’s something people hit reasonably frequently, it might be nice for Skuid to improve on Salesforce’s rather broken functionality. I know I’ve worked in a lot of multi-currency orgs, probably about half the projects I’ve done.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.