Replies: 2 comments 3 replies
-
The where clause should be used to cut down on the number of records used in a full recalc. You can disable the parent fields being reset for records that don't match, as well - that's a configuration option on the Rollup control record (Should Skip Resetting Parent Fields, IIRC). Full recalculations that mix and match where clauses (so, ones that are performed on multiple Rollup records at once) will retrieve a wider swathe of records that are then filtered down in each given calculation, but otherwise using a parent-level where clause should already be leading to the results you're looking for (with the exception, it sounds like, of the non-matches getting unintentionally reset, but hopefully that config option I mentioned covers that for you). Let me know what you think! I will of course support any other changes that need to be made. |
Beta Was this translation helpful? Give feedback.
-
My understanding is that it is generally considered best practice to set a custom numeric fields default to zero, and Chat GPT agrees and provides these guidlines Best Practice (Set Default to 0) Set default to 0 when: ⸻ Not Recommended (Don’t Set Default to 0) Avoid defaulting to 0 when: |
Beta Was this translation helpful? Give feedback.
-
Hi James,
If am rolling up transactions in a Transaction Object, to a Summary object which summarises the transactions by period (in this case, each period is a Year), but I want to reduce the amount of transactions picked up during a full recalculation, is there any way to do that?
E.g. Simple scenario, a full recalculation of the transactions relating to each year to the appropriate 'Period Summary' record works fine:
However, if I want to reduce the volume of transactions considered during a full recalculation, my thought was to add a 'WHERE' clause to specify to only roll-up periods where status = 'Open',
i.e. my rollup WHERE clause is
Period__r.Status__c = 'Open'
and then the full recalculation would skip over all the grayed out transactions because they belong to closed periods and just recheck the transactions in green add up to the green balance.
However, that is not what is happening. I cannot stop it rechecking the balances of all the years, even if they don't really need to be rechecked, but because of my WHERE clause, there are no valid transactions found, and this is results in the highly undesirable result of the closed periods which previously had a correct summary balance being incorrectly recalculated to zero.
I don't want to roll-up from 'Parent to Child', I still want the normal Child to Parent rollup, so that each transaction as it is created adds itself to the periodic summary in near real time.
However, I'm concerned that as the Transaction object gets huge, the unnecessary workload on a recalculation to recheck periodic totals which are never changing is a waste of time and may ultimately fail and become impossible to run in a large org.
Maybe I'm asking for a 'WHERE' clause on the Parent? i.e. only update Parent records who meet the criteria of the Parent 'WHERE' clause, with children which meet the criteria for the children 'WHERE' clause? That way I could specify 'Period__r.Status = 'Open' on the parent and reduce the workload on a full recalculation.
Any existing solution to this issue of course gratefully received!
Beta Was this translation helpful? Give feedback.
All reactions