SOQL Errors

When MoveData processes information into Salesforce it may result in a number of records being created or updated. In turn, you may have processes which are triggered on the basis of a record being created or updated. While rare, SOQL issues may present where governor limits are exceeded due to an excessive number of queries in the execution. In our experience there are two main causes for SOQL errors:

Process Builder, Workflow Rules, Flows

You may have a number of jobs which are executed through Process Builder, Workflow Rules or Flows. There is a significant performance penalty associated with each job, so consider combining where appropriate to create a more efficient batch. Generally speaking, Flows are more efficient that Process Builder or Workflow Rules so you may consider migrating out of these and into Flows. For an even more efficient result, you could consider reworking into Apex Triggers.

NPSP installed prior to 2019

If you have been using NPSP for some time you may have a large number of legacy trigger handlers. These are an abstracted version of Apex Triggers managed using an NPSP custom object npsp__Trigger_Handler__c. As of NPSP version 3.181 with Affiliations, Relationships, Recurring Donations and Households you should have 55 NPSP trigger handlers configured.

In older installs, we have seen over 161 trigger handlers configured. Culling triggers handlers which are no longer required will typically provide some SOQL limit relief. If you have not added custom NPSP trigger handler entries then you should be able to execute a full delete on the object:

  • Backup data in npsp__Trigger_Handler__c before actioning the delete

  • Open Developer Console and execute delete [SELECT Id FROM npsp__Trigger_Handler__c];

  • Open Query Editor to verify that the NPSP trigger handler entries have been recreated by executing the following SOQL statement: SELECT COUNT(Id) FROM npsp__Trigger_Handler__c

  • Reprocess any failed MoveData notifications and assess if the SOQL error is resolved

Last updated