SFDO-Community / declarative-lookup-rollup-summaries

Declarative Lookup Rollup Summaries (DLRS) is a community built and maintained Salesforce application that allows you to create cross object roll-ups declaratively - no code! For install instructions and documentation, visit our website https://sfdo-community-sprints.github.io/DLRS-Documentation/
https://sfdo-community-sprints.github.io/DLRS-Documentation/
BSD 3-Clause "New" or "Revised" License
690 stars 235 forks source link

Support In Memory Rollup: Multicurrency calculates on corporate currency and not record currency. Issues arises with rounding values after applying exchange rate. #284

Open patvachon77 opened 8 years ago

patvachon77 commented 8 years ago

Described in this video. https://www.youtube.com/watch?v=z5ylMzp9tBc

afawcett commented 8 years ago

Yeah so i've been round the loop on this before with Salesforce support, it has to do with how SOQL Aggregate functions work over Currency fields. If the tool where to read the records itself and do the additions in memory it would arrive at the correct value, however this is obviously less efficient data volumes wise.

Here is some other GitHub issues, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/217, https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/57

afawcett commented 8 years ago

This is post also gives an explanation of what SOQL Aggregate functions do with currencies and is what the tool is doing to convert to the parent current.

afawcett commented 8 years ago

I guess i could add an option in the rollup to have it not use SOQL Aggregate queries, retrieve all child records and add up in Apex code, but honestly i'm not sure this is really going to help much when the volumes go up and it starts causing governor and/or performance issues.

AllisonJames commented 8 years ago

TBH, I'm of help in how Apex does or doesn't work. What I do know is that in my situation I will only ever be dealing no more than a few records to rollup at a time, then I'm not sure there's any issue with governor and/or performance.

Can you add this other option and warn user when this option is chosen?

afawcett commented 8 years ago

Yep, that works, marked as enhancement!

RobLofaro commented 6 years ago

This seems to still be an issue in our org - and we are using the rolled up fields to produce customer facing quotes. Anyone in the UK will have incorrect values since they are GBP and corporate is in USD. Is there a workaround or fix?

afawcett commented 6 years ago

Yes, basically i need to merge this PR, https://github.com/afawcett/declarative-lookup-rollup-summaries/pull/591 do some testing and release it. I'll bump the priority of this item for my next round of work on this.

afawcett commented 6 years ago

See https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/82

afawcett commented 6 years ago

Added some comments to PR before merging, https://github.com/afawcett/declarative-lookup-rollup-summaries/pull/591

harrisoe69 commented 5 years ago

@afawcett Where is the final resolution for this?

Fr33zm4n commented 5 years ago

Still having this issue. Any idea at a deadline to fix this?

nickanderson86 commented 5 years ago

I am also having this issue. Would love an update. Thanks!

afawcett commented 4 years ago

So... i read on another issue someone say they created a Formula Currency field to shadow the physical currency field. They then used the formula field as the source of the aggregate and that resolved their issue. Thought I would share here. 👍 https://github.com/afawcett/declarative-lookup-rollup-summaries/issues/859

afawcett commented 4 years ago

https://github.com/afawcett/declarative-lookup-rollup-summaries/pull/591/files