Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [soql-limit-exception]

The tag has no usage guidance.

1
vote
2answers
107 views

How to resolve Webcallout error System.LimitException: Too many callouts: 101 when displaying data on Lightning component

I'm making a webservice callout to an external webservice and displaying data on a Lightning component. Data is returned in JSON format in multiple pages. Each page has 50 records. In my apex ...
6
votes
1answer
54 views

Create Case thread Id using Apex (SOQL limit-proof)

There are many posts about creating Case threadIds with Apex, notably Case.Thread_Id, is Thread_Id a field on Case object? As the posters have noted, the SFDC rules of the threadId are subject to ...
0
votes
0answers
22 views

Email-to-Case generalization

I'm writing a code that creates objects from Strings like this: Object_API_Name.Field_API_Name:value for example: Contact.Email:foo@bar.com I'd like to use this in email-to-case, so the String is ...
0
votes
1answer
22 views

Anonymous window Too many SOQL queries: 101

I've tried to execute the following script: List<Task> taskList = [SELECT status, CalculatedWorkingHours__c FROM Task WHERE CalculatedWorkingHours__c = -1.0 AND status = 'Completed']; ...
-1
votes
5answers
96 views

SOQL inside nested for loop

I'm displaying the accounts name those have cases attached in it. Accounts with no cases won't be displayed here. Unfortunately I'm facing 50001 error since I'm doing SOQL inside a for loop. But I'm ...
2
votes
3answers
33 views

Query sObject with different type

I need to do a query in the database, the idea is to retrieve at the same time all the object id's and do it in a way you don't touch the limits. Something like: [Select Id from sObject Where Id >...
0
votes
0answers
19 views

Too many soql query in Event relation [duplicate]

List<Event> newEventModuled = new List<Event>(); newEventModuled = [select Ownerid,Subject,what.name,Description__c,ShowAs,Time_Spent_In_minutes__c, ...
0
votes
2answers
155 views

getting an error : System.LimitException: Too many SOQL queries: 101 when deploying

All the test classes pass when I run them but I get validation error when I try to deploy: test class name: RELVSRenewalControllerTest method name: testaddServicedCommunityObjectNoFile error : ...
0
votes
1answer
53 views

Getting 101 SOQL limit exceeded error

I have two triggers : one on parent object(Opportunity) to update fields on child(opportunity_partner__c)and the other is on child(opportunity_partner__c) to update fields on Opportunity. I'm getting ...
3
votes
5answers
186 views

Get Namespace Prefix from calling class

I've got an issue with some managed package test classes (specifically CPQ test classes), where I'm running into SoQL limits when certain test classes execute. What I'd like to do is disable certain ...
3
votes
4answers
712 views

SOQL Where ID in Clause Limitation

I am dealing with some huge data and while querying I need to by pass many of them. So I am keeping ID in one List and passing them in the SOQL. Example: List<Id> idlist = new List<Id>();...
0
votes
1answer
302 views

Aggregated Query Too many query rows

I have this aggregated query which seems to return only 1050 rows but still I am getting a limit exception. This is the APEX query: AggregateResult[] groupedResults = [SELECT COUNT_DISTINCT(ID) cnt, ...
1
vote
1answer
34 views

Is this a selective SOQL?

Select Id, Field1_Id__c, Field2__c from CustomObject__c where Field1_Id__c =: STRING_CHARACTER_BLANK AND Field2__c IN: setOfIds Getting the following error when a query as above is executed from a ...
-3
votes
1answer
38 views

Can someone post an example of code that can induce “Governor limits” exception? [closed]

I am in need of code examples(Apex and VF) which can cause governor limits because i have not come across it in my experience
0
votes
1answer
302 views

How to query more than 50000 records in start method of batch apex?

Problem: I am using SOQL query to retrieve more than 50000 records inside start method and passing those records to query locator. I am getting this error :Too many query rows: 50001 in batch class. ...
0
votes
1answer
188 views

How to get more than 2000 records from custom object? [duplicate]

Problem I'm trying to make a standard query to get all records from salesforce custom object. I'm using SOAP API. I have more than 40k records in object. But salesforce OFFSET limit 2000 record. ...
1
vote
2answers
823 views

how to query more than 50000 records in batch apex?

Problem: **I am using SOQL query to retrieve more than 50000 records outside start method. I am getting this error at Line: 11: System.LimitException: Too many query rows: 50001** Error line: ...
3
votes
1answer
561 views

Skinny Tables - Salesforce

I read through some documents, and learned that Salesforce internally maintains metadata tables, pivot tables and large data tables, and salesforce kernel then performs queries on these tables to ...
3
votes
2answers
1k 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....
0
votes
2answers
380 views

SOQL query is unable to get (parent(Child (Child of child)))

Parent to child SOQL query, Unable to fetch data, giving this ERROR SOQL statements cannot query aggregate relationships more than 1 level away from the root entity object when I am querying ...
0
votes
1answer
97 views

SOQL Limit hit inside FOR Loop

I apologise in advance as i know this should be simple and other people ask this same question but no matter how i try to re-write my code i keep getting errors so ive given in and thought id ask for ...
0
votes
0answers
33 views

Apex class is failing

I have a requirement like need to display related opportunities for a specific lead with some criterias like sic,state,city. sic starts with criteria like sic in lead is 123 i need to opportunities ...
0
votes
1answer
42 views

How to assign object records to particular user/profiles?

How to assign object records to particular user/profiles? I want to assign object records to particular user or profiles, is it possible? can you share me the logic.
0
votes
0answers
38 views

SOQL AJAX Asynchronous Calls are getting failed in Safari, Internet Explorer

I am querying Salesforce db to get Attachments and their data. The soql calls are failing randomly in safari and IE but it works in Chrome. Weird behaviour , can any one explain ? Are there any limits ...
0
votes
0answers
235 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 ...
1
vote
3answers
172 views

Assistance to Bulkify this class processing custom objects

My org uses custom revenue schedule objects created via triggers and classes running off of the Opportunities. It is very complex (beyond my scope for updating in any reasonable time) - it uses a ...
0
votes
1answer
501 views

Need to optimize query result which should not be more than 50000 records in Survey Force unmanaged?

We are using the Un-managed package Survey force, which was enhanced based on our business requirement where it was completely stopped now. We could identify that the query limit was fetching more ...
0
votes
1answer
125 views

child query SOQL querymore in SOAP API?

we are using connection.query to get parent and child relationship records through the soap API. In some cases, our child query should return more than 200 records. Salesforce says that in Apex we ...
2
votes
3answers
2k views

Process builder and lack of bulkification

What is a valid robust use case for Process Builder when doing record updates? I've been running into an issue recently where every record update causes 1 SOQL and 1 DML per record which meets the ...
1
vote
1answer
334 views

How to achieve Querymore() in python salesforce rest api?

I am fetching cases from salesforce using python salesforce api. I have more than 800k cases. SOQL query Limit is 2000. if i am using OFFSET also, maximum offset value i can give is 2000. I want to ...
3
votes
1answer
1k views

Fetch more than 2000 records

I want to fetch 19k records from my org using Tooling API in Java. I have used LIMIT and OFFSET values in SOQL query to maintain sequence, the problem I'm facing is OFFSET is not processing values ...
1
vote
0answers
403 views

Hubspot - Process Builder - Too Many SOQL Queries

We're trying to track on leads/contacts when the first activity was sent. We built a pretty basic process that looks at activities created, if the WhoId starts with 00Q we know it's a lead and ...
1
vote
1answer
791 views

Process Builder SOQL Limit Error

I am building a solution that tracks and logs timestamps for various tasks in our system. I have built a flow in Process Builder to trigger based a couple conditions when a record is created or ...
6
votes
3answers
147 views

Scalable multi-parameter query

I have to do a SOQL query and I don't know how to do it in a scalable way. In a no scalable way it would look like: List<Items> items = new List<Items>(); items.add(new Item(1,1,2)); ...
2
votes
1answer
958 views

System.LimitException: Too many query rows: 50001 but only have 32000 rows

I have an aggregate function in the below SOQL query, this query is executed with this method Database.countQuery(), I only have 32000 rows but the error says I am getting 50001 rows. SELECT COUNT() ...
1
vote
2answers
100 views

How To Bulkify Visualforce Page Controller Displaying Hierarchy

I have a visualforce page that uses a junction object to display child assets. The page functions as expected, however when more than 100 records are returned, the VF Page breaks with the dreaded ...
0
votes
2answers
2k views

How to avoid ISOTrigger: System.LimitException: Too many SOQL queries: 101

I received the following error: Error: Invalid Data. Review all error messages below to correct your data. Apex trigger ISOTrigger caused an unexpected exception, contact your administrator: ...
4
votes
2answers
271 views

Is Hitting SOQL Limits Inevitable with Large Volume/Complex Flows?

I want to know if there is anything I can do to prevent hitting query limits when executing a rather complex, large volume flow. Here are the details: Solution Context: Data synchronization to update ...
0
votes
1answer
42 views

Error Message SystemLimitException

Below is my Test class code and when I run the test class I am coming across this error System.LimitException: Too many query rows: 50001 Stack Trace Class....
0
votes
1answer
347 views

Getting Error “System.LimitException: Too many query rows: 50001”

i am suddenly getting the following error in apex trigger : "System.LimitException: Too many query rows: 50001" Here is my apex trigger code : trigger SetAmountfromOTTtoSFDC on Opportunity (Before ...
1
vote
1answer
1k views

Receiving query limit error “Request was Running for too long and has been stopped.”

I have batch which queries for record in a standard object which has 16 million of records. I am trying to query only few records with checkbox checked using querylocator to delete it . However the ...
3
votes
1answer
76 views

SOQL retrieve limited?

I'm doing an integration using Partner WSDL. When I try to retrieve more than 15 Leads, it's return NullPointerException and I have 43 Leads. When I try to retieve all my Contacts, it's just return ...
0
votes
1answer
68 views

EventnEventRelationtrigger: System.LimitException: Too many query rows: 50001..Working on Sandbox

I have a trigger(AI/AU) on Event staging object, which creates Events once the records are inserted into Event Staging. I am getting System.LimitException: Too many query rows: 50001 exception ...
1
vote
1answer
166 views

Finding the loop causing too many SOQL queries?

I've been tasked to create a Task trigger that updates account and lead fields with certain information when criteria are met on a trigger, including a custom "rollup summary field". This seems to ...
5
votes
2answers
645 views

Limits for inline Query

I have an account record having name 'POC', This account has 5000 contacts. Now I am querying in Execute anonymous 1. List<Account> accounts = [Select Id, Name, (Select Id, Name From ...
0
votes
1answer
438 views

Workarounds to avoid 101 SOQL limit exception

I am in critical situation due to below error "System.LimitException: Too many SOQL queries: 101" Whenever we are moving any changeset to production we are getting the above error. We followed ...
0
votes
1answer
38 views

Review soqls on debug log to avoid too many soqls limit

I have a test class which calls a visual force page and executes methods in apex controller. Currently the test class is failing on too many soql limits exception. I am trying to debug which soql ...
1
vote
2answers
38 views

Update 4 fields on a one record based on the values in 4 related records?

I am looking for the most efficient way to modify a single record based on the result of 4 specific records. Specifically we are using a custom fiscal period system. This means that every date ...
5
votes
2answers
294 views

What kind of actions open a query locator

We use a batched approach for read and update CampaignMember records within an external application (Webservice Connector, or WSC SOAP API). The approach can be described like this: Query campaign ...
4
votes
2answers
523 views

Subquery limit handling

Can someone help me in the below scenario. Scenario: I have a list of account id's. In that list of id's i want to separate the list of id's which have contacts associated to an account and the list ...