Skip to main content

Questions tagged [limitexception]

Filter by
Sorted by
Tagged with
14 votes
1 answer
3k views

Is DML not allowed in a Visualforce getter?

Summary I am trying to simplify some code for a page that makes a callout, then logs the request and response. I stumbled across a scenario in which the log record appears to create successfully, but ...
Adrian Larson's user avatar
  • 151k
8 votes
3 answers
13k views

Storable Action - System.LimitException: Too many DML statements: 1

@AuraEnabled(cacheable=true) public static String deleteContacts(List<String> contactIds) { List<Contact> returnList = new List<Contact> (); String query = ' SELECT Id,Name, ...
keepler's user avatar
  • 384
6 votes
2 answers
4k views

System.LimitException: Too many SOQL queries: 101

I am calling sendemail() from visualforce.There are no SOQL Queries inside for loops but am getting error in controller. If I comment below two lines then am not getting error Messaging....
sfdc's user avatar
  • 13.7k
5 votes
1 answer
675 views

How do I replicate an apex heap size exception in a test class?

We've received an Apex heap size too large error intermittently which we'd like to first capture and exit gracefully, and then to fix long term. Questions: Is it possible to catch a heap size ...
willard's user avatar
  • 1,022
4 votes
1 answer
401 views

Querying of Apex Properties

In a controller for a visualforce page, that I have constructed, I have the following: public User current_user { get { return [SELECT Name /*... other fields ...*/ FROM User WHERE Id =: ...
Konnor McDowell's user avatar
4 votes
1 answer
5k views

How to get past the URL limit error of maximum 4096 characters?

I've a need to generate a PDF with dynamic content intercepted by end user in an editable input form. So, I tried reading everything on the form into a string and passed the string as a URL parameter ...
VarunC's user avatar
  • 6,010
3 votes
1 answer
3k views

LWC: Maximum Blob Size From JS To APEX

I want to make a "custom file upload" LWC component as I am in need to build a specific design for an upload process. There are a few things I am not sure about. What would be the maximum size of a ...
Arthlete's user avatar
  • 4,989
2 votes
1 answer
847 views

OrgLimits.getAll() works only with Anonymous apex and gives exception when used in any other context

I have a simple command on Orglimit which runs fine if run in anonymous as below system.debug(OrgLimits.getAll()); 20:25:55:076 USER_DEBUG [2]|DEBUG|(OrgLimit:[delegate=apex.sfdc.orglimits.OrgLimit@...
Anil Shivaraj's user avatar
2 votes
1 answer
211 views

how to abort upload file when filesize is too large

I have a apex:inputFile tag to upload a file I gave it an id to throw an error if the filesize exceeds 500k. The error is thrown but still I can see in my left corner of my chrome browser an attempt ...
Thomas's user avatar
  • 2,320
2 votes
0 answers
64 views

"Too many SOQL queries" error and other strange things in Recommendation Strategy Flow

I have a Recommendation Strategy Flow, used in Einstein Next Best Actions for a Case. The start of it looks like this: Sometimes I get a batch of "Too many SOQL queries" errors from this ...
Sander de Jong's user avatar
2 votes
0 answers
879 views

"LimitException: Batchable instance is too big" when scheduled batch runs at night

Note: This is not a duplicate of the other similar questions. We checked them before. So please don't close this as a duplicate! When calling this batch class in a production org: global class ...
Robert Sösemann's user avatar
1 vote
2 answers
517 views

Avoid too many SOQL calls in APEX Select COUNT()

I am trying to create a count summary of all calls logged by a specific sales rep (as Task) for each of his prospects (e.g. 8 calls for prospect A, 14 for B, etc.) using Apex. Below is what I got so ...
wp78de's user avatar
  • 191
1 vote
2 answers
7k views

What is Salesforce Daily api limit per user per 24 hours?

According to Salesforce Documentation, Salesforce Unlimited editions have a limit of 5,000 API calls Per License Type, per 24 hours and the total API calls per 24 hours are: 100,000 + (number of ...
Isha's user avatar
  • 163
1 vote
1 answer
495 views

Conflicting triggers

I'm still new to Salesforce and still can't grasp regarding triggers. Scenario: My company's salesforce workspace has a managed package app installed. The managed package app has a custom trigger for ...
qaxi's user avatar
  • 113
1 vote
1 answer
559 views

Maximum stack depth reached: 1001 inner class

I'm trying to export record on into a tab separated text file. In getting Maximum stack depth reached: 1001 in the inner class where i'm doing the piece of code and I have pasted full code in the ...
Mohammed Imran's user avatar
1 vote
0 answers
95 views

Query plan shows very high cost for a standard indexed field

I am very confused by the plans available for this simple query which uses a foreign key as a filter. My understanding is accountid on Contact is indexed since it is a primary key and I have given a ...
codingislife's user avatar
1 vote
0 answers
638 views

ECONNRESET error on salesforce API calls at random

I am trying to integrate with salesforce and after a few mins-hours some API calls are failing at random Following is the error captured: { Error: Client network socket disconnected before secure TLS ...
Ashish Prasher's user avatar
1 vote
0 answers
101 views

Test Class failing with Too many SOQL queries: 101

My test class is public static testMethod void loanSetDelegatedApprovers() { list<User> userList = new list<User>(); list<Approval_Delegate__c> adList = new list<...
Eagerin Sf's user avatar
  • 1,085
0 votes
2 answers
912 views

Why catch code of an try catch exception are not executed when System.LimitException: Too many DML statements: 151

I have the next code block that generates a limitException: Account myAccount = new Account(Name = 'MyAccount'); Insert myAccount; For (Integer x = 0; x < 150; x++) {Account newAccount = new ...
alejandro's user avatar
  • 109
0 votes
1 answer
179 views

MassEmailMessage vs “Too many Email Invocations: 11”

I don't know, how to fix it: my messages are in List. Helper: public with sharing class Helper { public static void afterInsert(List<P__c> newList, Map<ID, P__c> newMap){ List<...
Monte Cristo's user avatar
0 votes
1 answer
501 views

Too many query rows : 50001

Added as many conditions as i could. Don't want to put a LIMIT as there are less than 76k Accounts of this particular record type. Is there any other way to overcome the System.exception: Too many ...
GroundToCloud's user avatar
0 votes
1 answer
561 views

Batch Apex System.LimitException: Too many query locator rows: 50000001

There is a object(assume A) which will store event logs for a custom object(assume B). A batch job, runs weekly on object A to delete the records based on some conditions. It throws an exception like ...
Lokesh's user avatar
  • 165
0 votes
2 answers
142 views

System.LimitException: ivybat:Too many SOQL queries: 101 - Stack Trace

I am getting this error as my unit test are failing and in the stack trace getting class names which are not related to my test class. Object name is also appended in the error, the object name is ...
Giri Liyangi's user avatar
0 votes
1 answer
674 views

Getting an Error on a scheduled job, but can't find the error

We have a scheduled job on Contacts that runs once a week. We have a couple processes that are also on Contacts. We are in the process of transitioning Workflow Rules into our Processes. Some there ...
Dan Watkoski's user avatar
0 votes
1 answer
210 views

Unsure why: System.LimitException: Too many SOQL queries: 201

I am running into the infamous System.LimitException: Too many SOQL queries: 201 error, but I am really not sure why. In this class I am attempting to get a JSON object from a URL and then use it to ...
Kris Webster's user avatar
0 votes
1 answer
169 views

FATAL_ERROR System.ListException: Before Insert or Upsert list must not have two identically equal elements

In below block of code I am trying to insert 4 accounts first 2 of type aType and then 2 more of type bType. Account[] accountToInsert = new Account[0]; Account[] accountToInsertAtype = new Account[...
gs650x's user avatar
  • 2,708
0 votes
1 answer
2k views

too many dml rows: 10001 when calling batch apex from Trigger

I am calling a batch class from trigger after update. Eg: database.executeBatch(new myTestBatch(trigger.newMap.keySet()),200); But it gives Too many dml rows:10001. This is my batch class. global ...
sThirumagal93's user avatar
0 votes
2 answers
73 views

System.LimitException: Too many Email Invocations: 11

// Original Code for(Account obj :updateAsDuplicate){ obj.Duplicate__c = true; for(String oldStr : hasExternalIdOldSet){ if(obj.Id.equals(duplicateMap.get(oldStr))){ ...
GroundToCloud's user avatar
0 votes
2 answers
62 views

maximum trigger depth exceeded while updating old child records

I tried to check previous answers here for similar issue but I could not apply it in my condition We have a scenario where Account is master and Annual Potential is a child object, THe scenario is ...
Samuel Robert's user avatar
0 votes
1 answer
156 views

Anonymous Apex - System.LimitException: Too many SOQL queries: 101 - No DML In LOOP?

I am getting the "Too Many SOQL queries" error on the code below when executing as anonymous APEX in my sandbox. But by my reading of "best practices" I thought I'm doing things right - I was careful ...
Jay Tracewell's user avatar
0 votes
1 answer
29 views

message: System.LimitException: Too many query rows: 50001 Class.CollectionMaster.getCollectionMaster: line 16, column 1

@RestResource(urlMapping='/CollectionMaster/*') global with sharing class CollectionMaster{ @HttpPOST global static CollectionWrapper getCollectionMaster(String userName){ list<...
Madhav Jani's user avatar
0 votes
3 answers
1k views

System.LimitException: Too many query rows: 50001 Class.CollectionMaster.getCollectionMaster: line 17, column 1

@RestResource(urlMapping='/CollectionMaster/*') global with sharing class CollectionMaster{ @HttpPOST global static CollectionWrapper getCollectionMaster(String userName){ list&...
Madhav Jani's user avatar
0 votes
1 answer
203 views

System.LimitException: Too many SOQL queries

I wrote a trigger to update a field (boolean value) in LEAD when a TASK is added to the lead. Trigger works fine in DEV box but when I deploy it, its giving me Exception error clashing with one other ...
Jag's user avatar
  • 1
0 votes
1 answer
90 views

system.limitexception: too many callouts: 101 error Salesforce

public with sharing class ToolingAPIUtility { public static final String endpoint = '/services/data/v51.0/tooling/query/?q='; @InvocableMethod(label='Get Alert Data' description='Get Alert ...
Sahir's user avatar
  • 5
0 votes
0 answers
38 views

Too many query rows exception during Data load

We have a trigger on a parent object where we query the child records for newly inserted/updated parent records. We are getting too many soql exception when more than 50K parent records are loaded. We ...
Raham's user avatar
  • 43
0 votes
0 answers
93 views

Got a limit exception error even when the soql query is outside the for loop

just a question. Let's say I have apex class that are updating bunch of records using dml in a list which will trigger if the picklist is change, then execute the code. If a dml is triggered, will ...
Squidward's user avatar
0 votes
3 answers
362 views

Accesssing child records Count towards System.limit exception?

I am trying to loop over child records via accessing child records through relationship(customer_MDM_Customer_Address__r) and not doing any query inside for loop but still getting too many SOQL ...
Dhruv's user avatar
  • 11
0 votes
0 answers
111 views

Avoid Apex Schedule limit

We have a requirement to launch two schedule apex each hour but we're reaching schedule limits. I have this piece of code in apex: public void finish(Database.BatchableContext BC) { Datetime now = ...
molinet's user avatar
  • 925
0 votes
1 answer
356 views

How to pull SOQL-query out of the loop in the trigger [duplicate]

Hello) I need to create a trigger that will record the number of reviews and the average rating from custom object (Review__c) in the corresponding fields on other custom object (Job_Applications__c). ...
Valentin Romanov's user avatar
0 votes
1 answer
125 views

Apex trigger Too many SOQL queries: 101

Getting an error in Line 8 in the query in the constructor contactFindNextLastVisit. Can someone see what that might be? There are no SOQL statements in for loop. public class ...
user68417's user avatar
0 votes
0 answers
78 views

used system.enquejob but still facing System.LimitException: Too many future calls: 51 [duplicate]

My trigger trigger triggSendRebateData on RebateData_for_MC__c (before insert,before update) { List<RebateData_for_MC__c> lstRebateData = new List<RebateData_for_MC__c>(); for(...
Eagerin Sf's user avatar
  • 1,085
0 votes
0 answers
490 views

How to solve Limit Exception : Too many query rows 50001

I have a code which retrieves and displays the results in the VF page from REST Web-Service. In one sandbox , it's working fine. But in other sandbox it returns following error: Limit Exception ...
ram135868's user avatar
0 votes
2 answers
683 views

Creating Tasks - System.LimitException: Too many DML statements: 151

To complete this challenge, you need to add a trigger for Opportunity. The trigger will add a task to any opportunity inserted or updated with the stage of 'Closed Won'. The task's subject must be '...
manideep's user avatar
-1 votes
1 answer
152 views

How to get CPU consumed by each Apex [closed]

I am trying to find some way to build an application/report which shows CPU time consumed by each class per execute. Please refer below table to get more details of the ask. APEX Class Consumed CPU ...
Mehul's user avatar
  • 1
-1 votes
1 answer
56 views

Too many query rows: 50001 in Production

We are getting Too many query rows: 50001 error in production during a data load activity of an Sobject. we have an active trigger on this Sobject. But we have only 14K records for this object in ...
Raham's user avatar
  • 43
-2 votes
1 answer
118 views

Limit on query rows

I am trying to write a trigger to update the manager on the user record. So, I created a custom text field which would be populated with the user's manager Name and I'd then fetch the managerID based ...
Priya's user avatar
  • 113