SalesforceFoundation / NPSP

The current version of the Salesforce.org Nonprofit Success Pack
http://www.salesforce.org/nonprofit/nonprofit-success-pack/
BSD 3-Clause "New" or "Revised" License
16 stars 3 forks source link

Recurring Donation is not deleted if Account/Contact are deleted #2377

Closed judisohn closed 7 years ago

judisohn commented 8 years ago

We are seeing users who are getting NPSP Error emails with the error "Attempt to de-reference a null object"

This appears to consistently be because the Organization and Contact are blank on a Recurring Donation record.

I don't believe this is bad data entry. When you insert a Recurring Donation without an Organization or Contact, you get an error.

This is a consistent way to reproduce the error and may be why our users are hitting it - when an Account (or Contact) connected to the Recurring Donation is deleted, the Recurring Donation is left behind! The nightly batch is attempting to roll up that now orphaned Recurring Donation record and getting the exception.

Steps to repeat:

  1. Create Organization Account (or Contact)
  2. Create Recurring Donation, open, $1, Yearly Installment Period (so there's only 1 opp created)
  3. Delete Organization Account (or Contact)
  4. Run Recurring Donation Rollup - get 'Attempt to de-reference a null object."

Recurring Donation is not deleted as part of the cascade delete of Account/Contact (even though the Opportunities are deleted).

Delete behavior should remove orphaned Recurring Donation, and/or those records should not be calculated in the batch update.

judisohn commented 8 years ago

**lurch: add

LurchTheButler commented 8 years ago

Tracking W-016967

jlantz commented 7 years ago

Included in beta release 3.87 (Beta 7)

judisohn commented 7 years ago

@jjbennett @davidhabib This is not working correctly in 3.87. Tested in my org (multiple times) and QA org.

STR:

  1. Create Household Contact
  2. Add Recurring Donation (open)
  3. Delete Contact (with override button)

Result:

Error in log:

image

In my org, I received 2 identical emails:

Errors:


Error #1:

Error Type: Other Error Date: 2016-12-21 12:59:22 Message: "entity is deleted" https://npsp.na35.visual.force.com/a0941000001mbvyAAA

Stack Trace: null


Error #2:

Error Type: System.ListException Error Date: 2016-12-21 12:59:22 Message: "List index out of bounds: 1"

Stack Trace: Stacktrace available at the time of saving the record - (npsp)

mrbelvedere commented 7 years ago

Included in production release rel/3.89