How to Modify a SOQL Query with Two Objects

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.

For those of you that want to modify the Year End Tax Receipt for your specific donors:

  • 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]          
    
Continue reading How to Modify a SOQL Query with Two Objects

Should My Donation Page Default to Recurring Monthly Gifts? Ask Trump

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.

Continue reading Should My Donation Page Default to Recurring Monthly Gifts? Ask Trump