Re: Salesforce Sync issue: Too many SOQL queries

Matthew_Mooney
Level 1

Salesforce Sync issue: Too many SOQL queries

Hello,

I have had many leads that were unable to sync with the following error message: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY: ContactPrimaryFlag: System.LimitException: Too many SOQL queries: 101    I suspect this is an issue with Salesforce and I believe the issue is the high number of workflows and validation rules we have in our Salesforce instance.  I had the same problem using Data Loader and the solution was to change the batch size in the Data Loader settings.  This resulted in a slower process, but no issues with too many SOQL queries.  I have not been able to figure out how to limit the batch size for Salesforce sync.

Has anyone had the same issue regarding the Lead sync from Marketo to Salesforce? Does anyone have a solution?

Thank you,

Matt

3 REPLIES 3
Josh_Hill13
Level 10 - Champion Alumni

Re: Salesforce Sync issue: Too many SOQL queries

Some questions you should ask:

  • Check Admin>API to see how many API calls you are making. This is not an SFDC issue, but if it is alot, that could be a symptom.
  • Admin>SFDC>Sync Activities - if this is on, you should consider turning this OFF and relying on Sales Insight or much narrower range of Tasks within workflows.
  • Are you syncing all leads to SFDC?
  • How many flows are controlling the sync? Are you syncing Programs-SFDC Campaigns? This could increase the volume that is hitting your SFDC triggers.
  • Yes, consider ways to throttle your SFDC triggers.
  • You may want to call Support or SFDC support to dig into this issue more.
Matthew_Mooney
Level 1

Re: Salesforce Sync issue: Too many SOQL queries

Thanks Josh,

I'll look through all of your suggestions/questions and post a response soon.

Ed_Dunn
Level 1

Re: Salesforce Sync issue: Too many SOQL queries

is there a way for Marketo support to change MKTO to SFDC sync to use 100 per API call rather than 200 records per API call? This would get around the Apex CPU time limit exceeded and System.LimitException: errors