You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.LimitException: LabsActionPlans:Too many SOQL queries: 101
When trying to insert EmailMessageRelation objects in bulk.
Here is the code to recreate the error:
List<EmailMessageRelation> ems = new List<EmailMessageRelation>();
Id conId = [SELECT Id FROM Contact Limit 1][0].Id;
Id emailMessageId = [SELECT Id FROM EmailMessage Limit 1][0].Id;
for (integer i = 0; i < 30; i++)
{
EmailMessageRelation emr = new EmailMessageRelation();
emr.RelationType = 'ToAddress';
emr.EmailMessageId = emailMessageId;
emr.RelationId = conId;
ems.add(emr);
}
insert ems;
The text was updated successfully, but these errors were encountered:
Receive the following error:
System.LimitException: LabsActionPlans:Too many SOQL queries: 101
When trying to insert EmailMessageRelation objects in bulk.
Here is the code to recreate the error:
The text was updated successfully, but these errors were encountered: