A SOQL query pulls certain records and fields into Apex Code. This post explains a SOQL query that includes Contacts and their related Opportunities from the Year End Tax Receipt app, but I aim to help you understand SOQL in general.
Follow along with this post to modify which records will be displayed in the table of gifts last year. We’ll look at an example of only included gifts marked tax deductible.
Look at the original post to learn how to modify which columns appear in the gift table.
Understand the SOQL
Here’s my SOQL query. This is how I get the records and fields that I’m going to do something with later on in the code.
1 [SELECT LastName, id,Gifts_Last_Year__c,
2 (SELECT Id, CloseDate, Amount FROM Opportunities
3 WHERE CALENDAR_YEAR(CloseDate) =:year
4 AND IsWon = True
5 ORDER BY CloseDate)
6 FROM Contact WHERE npo02__OppAmountLastYear__c > 0
7 WITH SECURITY_ENFORCED]
UPDATE 1/13/23: If you’re installing today from AppExchange, it’s a new version 1.4 that you can run by running a flow called Year End Tax Flow. New detailed instructions below. To install the new version, please uninstall the old version first! Go to Setup, search for “Installed Packages,” find “Year End Tax” and uninstall that.
Easy peasy list of all last year’s donations
Send your donors (contact records only) a tax receipt at the beginning of the new year listing all of last year’s donations. For Salesforce Nonprofit Success Pack users, this unmanaged package will generate a table for each donor listing the gifts they made last year. Use your own email to send a tax receipt by email. The table lists the amount, date and, optionally, the campaign name of each donation.
Before the proverbial ink dried on the first article on why you shouldn’t Salesforce volunteer at a nonprofit, I could already sense the exceptions the community would raise that I didn’t have the time to address. The Salesforce Trailblazer Community, after all, is made up of passionate tech nerds who have a keen eye in finding exceptions to things. It’s in our nature since we have to sniff out those nuances to be great at what we do.
Folks sent in anecdotes, counter-points, and personal stories about how their experiences were mutually beneficial and what I put out there was a disservice to the nonprofit world. My opinion is that those experiences are the exception, and don’t reflect the greater trend of nonprofits that are harmed when a volunteer is only using them to get experience.
Nevertheless, there is merit in the exceptions raised. So, this follow-up aims to address those exceptions, and clarify when it is a good idea to Salesforce volunteer at a nonprofit.
“Here is the use case: sending a family of a deceased relative one letter with all the names of people who have donated in memoriam. So, one letter to the family for many people who gave. Client is a large hospice so this is happening weekly. Open to different options — apps? exports & merge? other? Thanks!”
Broad use case: Use the new Collection Sort feature in Flow to find a specific number of records that meet your criteria, and sort them with one or more criteria (criterion?)
Example use cases: I want my top 3 open opps to have a giant dollar sign image on them or I want to automatically nudge/shame the five users who logged in least last month or I want to focus a campaign on my most active volunteers in the summer.
Our specific case: I want to look at a contact record in Nonprofit Success Pack and see immediately that they are one of my top ten donors.
On Tuesday, I gave a webinar with 4 tips to improve your online fundraising. Tip #3: “Thoughtfully set up recurring gifts.” Well, “thoughtfully” means two things: 1) with a lot of thought and 2) “with consideration for the needs of other people.” (Google’s English Dictionary). I meant both.
When the Trump’s campaign set up their donation pages with WinRed, they used deceptive design techniques to trick people into recurring and multiple gifts, says The New York Times. According to Harry Brignull, a user-experience designer quoted in the article, “the Trump team’s techniques were a classic of the ‘deceptive design’ genre. ‘It should be in textbooks of what you shouldn’t do,’ he said.”
In the webinar I suggested that organizations test out defaulting to recurring gifts to see how that works for them. One of my colleagues who has thoroughly studied the success of online fundraising efforts advised me against straight out recommending organizations default to recurring because it really depends on the donor base.
This post is building on the work of the super-smarty Narender Singh aka ForcePanda aka @Nads_P07. With Spring ’21 rich text emails, you can now send tables with lists of child objects.
I followed his tutorial and built two flows specifically using Nonprofit Success Pack (NPSP) objects. The first one is a list of payments and the second is a list of completed volunteer activities. I’ll blog about the second one later. Also on the to-do list is to make one that lists all the gifts received in memory or in tribute to someone else.
“I am trying to set up an autolaunched flow to remove Opportunity Contact Roles from open opportunities with deceased contacts. (For example, we are soliciting a major gift from a couple, and one of them passes away before the donation is received.) I have successfully configured a process to remove the deceased contact from acknowledgement for that gift when it comes in, but for the sake of clean data I would like to also automatically remove their OCR from the opportunity record. I am coming up with ‘unhandled faults’ and hoping since this is only my 2nd flow ever that someone will be able to see an obvious error with my configuration.