Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a way via code to do what this button does?

enter image description here

share|improve this question
up vote 5 down vote accepted

Let me say first that forcing RSF recalculations incurs a performance hit. You shouldn't need to do it programmatically.

That said, each of these actions will trigger a recalc. I believe you can do each of these through MD API (it's not Apex though, I know). Source:

  • Changing the roll-up summary definition (such as the object, function, or field being aggregated)

  • Changing the expression of a formula field referenced in a roll-up summary field

  • Replacing picklist values for picklist fields referenced in the roll-up summary filter

  • Changing picklist record type definitions

  • Changing currency conversion rates

  • Changing price book entries

(But if you have a reproducible case where you can predict you'll need a forced recalc, I'd very much like to hear about it.)

share|improve this answer
My other question I created explains it:… – dphil Aug 5 '14 at 19:35
I assume you meant this one:…. Hmm, I wonder if DBAmp is doing something other than a plain insert. If I were you I'd file a case with them, if possible. – Carolyn Grabill Aug 5 '14 at 21:17
O yea that one. We tried that and they don't really know whats going on and didn't give any good ideas to work around it. – dphil Aug 5 '14 at 22:58

I believe updating any child record should kick of the asynchronous recalculation of the roll-up summary.

share|improve this answer
but would that be for all records or just the parent record of that child? – Jagular Aug 5 '14 at 18:47
Updating any child record should do it. SF might do a ISCHANGED(field_to_be_rolled_up__c) check though. – Scott Pelak Aug 5 '14 at 18:59
Yes, unfortionately it's not. The issue seems to be when new children are created though. – dphil Aug 5 '14 at 19:34
Try a test: update a parent then update a child and see if anything goes – Scott Pelak Aug 5 '14 at 19:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.