Catching recurring donation weirdness

Anna Hazel Crotty
2 min readMar 22, 2018

--

If you use the nonprofit success pack from Salesforce and you use the recurring donations object a lot (or in interesting ways) you may have seen it create the occasional bad child opportunity. There are references to this behavior in the Power of Us Hub, often with references to the Installments field being changed. I’ve seen this but can’t reproduce it (or even screenshot it, which is why I usually refer to it as Bigfoot.)

On March 20, 2018, Salesforce pushed an update to the NPSP that included some changes to the recurring donations, and it caused problems for a few of us. One problem I’m seeing is that when a child opportunity of an open recurring donation was marked closed lost, that closed lost opportunity had its close date changed by + one year. Since this money didn’t come in, the date isn’t super important, but this is scary behavior and it makes me nervous.

Also within the last month I found a set of recurring donations that I’d created in March 2017 that wound up with duplicate March 2018 donations. That’s extremely bad in my little world, and cleaning it up was a major pain in the ass. I also got very frustrated just trying to identify which recurring donations have a problem.

Clearly time for pandas!

To use this little bit of code, you’ll need to create a Salesforce report (report type Opportunities with Recurring Donations) that includes Recurring Donation Id, Opportunity Id, and Close Date. You can include other values if you’d like, but they won’t do you any good.

I’ll get this up on github eventually but I’ve got a lot of orgs to check right now.

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
pd.options.display.max_rows = 5

recurrings = pd.read_csv(‘/Users/annacrotty/Dropbox/Private/Consulting Business/python scripts/recurrings/sfreport.csv’)

recurrings[‘Close Date’] = pd.to_datetime(recurrings[‘Close Date’], errors=’coerce’)

recurrings[‘display month’] = recurrings[‘Close Date’].dt.month

summary = recurrings.groupby([recurrings[‘Recurring Donation: Record ID’],
recurrings[‘display month’],
recurrings[‘Close Date’].dt.year,
recurrings[‘Close Date’].dt.month]).agg({‘count’})

problems = summary[(summary[‘Opportunity ID’, ‘count’]>1) ]

If you need to send problems to a .csv because it is more than a handful of recurring donations, you can obviously do that, too. I just took the recurring donation ids that showed up, plugged them into the url and took a look.

--

--