Why am I getting the error "...npsp.TDTM_Contact: System.LimitException: Too many SOQL queries: 101"?

Whenever an error message includes "TDTM" it usually means that NPSP (Nonprofit Success Pack) automation is adding SOQL queries to the operation causing it to hit Salesforce limits and fail. This most often happens when deduping Contacts or Accounts using Apsona's Dedupe and Match tool.

There are two ways to address this. The quick way is to check the "small batches" checkbox when running your dedupe operation. This will reduce the batch size of the dedupe job to 5 records at a time. This doesn't negatively impact your dedupe action in any way, it just edits 5 records at a time instead of the default 200 records at a time that Salesforce uses. The main consequence is a slightly slower dedupe job.

Screenshot 2024-09-11 at 11.51.43 PM.png

The second option is to visit Apsona->Settings->Connection Settings-> And reduce the batch size to as low as needed (even as low as 1) to avoid hitting those limits. NOTE: This is a temporary batch size reduction and will have to be done before each dedupe operation. Also note, there is no danger in changing this setting. Batch size refers to the number of records Salesforce processes at once. If you are deduping 50 sets and you set the batch size to 10 it means that Salesforce will process 10 dupe sets, complete the process, and then move on to the next ten, and so on, until the operation is complete. If you change the batch size to 1, then Salesforce will process and complete one dupe set at a time until it finishes all 50. The only consequence is that the operation takes a little longer to complete. NPSP has a lot of automation that runs in the background, and this batch size reduction may be unavoidable.

Screenshot 2024-09-11 at 11.15.22 PM.png

Technically there is a third option: Temporarily turning off NPSP automation to avoid hitting these SOQL query limits. This should only be used if the user is an experienced Salesforce admin and you've exhausted all other options.