2

We use DBAmp to import records from another system. Everything works fine except for when creating a new record. The record does not roll-up via the summary field on it's parent. Any ideas or other information that might be helpful to help me solve this problem?

4
  • do you see an #Error or just wrong numbers in the summary field on the master record?
    – Rao
    Aug 5, 2014 at 16:08
  • @rao No error. It's just the wrong numbers on the master numbers.
    – dphil
    Aug 5, 2014 at 16:56
  • drphil - I know this is 2 years old, but what was the solution? I have the same issue in my org today.
    – user36793
    Aug 25, 2016 at 14:07
  • I believe that the operation was running in parallel as opposed to serial and was causing record locks on the data. I believe the issue was on the DBAmp end to make that change. You might need to do a google search on how to make that change. Welcome to StackExchange and please note that your answer here is going to get deleted soon since it is not a true answer.
    – dphil
    Aug 25, 2016 at 14:12

1 Answer 1

2

My understanding is upon any DML of children records of a Master-Detail relationship should kick of the asynchronous recalculation of any roll-up summary fields on the master record. Checking the Master Object, a recalculation is is still processing if there is a little purple icon next to the roll-up summary field.

If I am mistaken above, a work-around is to simulate your own roll-up summary by (1) creating a field on the Master and (2) writing a trigger on the Child that calculates the roll-up value if the field-to-be-rolled-up changes.

The work-around isn't too difficult to write, but it's not the desirable solution -- the Master-Detail should already be doing this!

My guess is that you are processing a lot of records causing a lengthy recalculation. If true, then the recalculation should occur eventually. If false, this issue has to have been documented somewhere before -- though that "Force a manual recalculation" option may be there for a reason.

Doc: https://help.salesforce.com/HTViewHelpDoc?id=fields_about_roll_up_summary_fields.htm&language=en_US

"Roll-up summary fields may take up to 30 minutes to recalculate"


Update

Check out this doc on Bulk API and search for "Roll-up summary":

https://developer.salesforce.com/page/The_Salesforce_Bulk_API_-_Maximizing_Parallelism_and_Throughput_Performance_When_Integrating_or_Loading_Large_Data_Volumes

I bet your 3rd party software is using Bulk API, and maybe the ordering of how you're upserting records is causing "lock contention" with the Master records hence causing a roll-up summary failure.

4
  • Yea, the problem is that days go by and they don't recalc. I really didn't want to go the trigger route but I'm prepared to if I need to.
    – dphil
    Aug 5, 2014 at 19:31
  • With a trigger, just a heads up that it might be beneficial to use an @future to recalculate the roll up so you get another execution context to work in Aug 5, 2014 at 20:00
  • Added an update Aug 6, 2014 at 12:41
  • Thanks! I read through that document and it looks like running in parallel as opposed to serial could cause record locks on the data. I have to wait until our SQL admin is in tomorrow to find out if he is executing the special command that makes it run in parallel instead of serial.
    – dphil
    Aug 6, 2014 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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