function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
IGLIGL 

Problem with Workflows and Triggers

Hi,

we have a problem in our company that i dont know how to resolve.

Step 1: We have to modify a field in all the new lead that comes, its working.

Step 2: This modification will fire a trigger that create documens asociated to the lead,

working but when are more than 10 documents the next error fire: "Too many SOQL queries: 21"

 

Then next step work but only if we do it throught a independient workflow but we dont know how to do that the last trigger do it: 

 

Step 3: We need that the process create 4 based timed WorkFlows that will send an email to the lead, working.

 

WF Process

 

 

Any suggestion??

Thanks a lot

 

MiguelGuerreiroMiguelGuerreiro
Step 2: you probably have your SOQL statement inside a loop.
NBlasgenNBlasgen

Their point *is* to put it inside a loop (so to speak).  So I'm not sure why attaching a document is causing two SOQL queries.  You must be doing something a tad strange there.  I can understand one SOQL query per document.  Maybe you can show us a sample of the trigger code?

 

I see no issue with doing step 3 as an indepenant workflow.  Have the trigger do something that fires the workflow.  That seems fine.