Questions tagged [governorlimits]

Governor limits are limits enforced by the Apex runtime engine to ensure that runaway Apex does not monopolize shared resources in the multitenant environment. These limits are tracked and enforced during the execution of Apex code and if a governor limit is exceeded an uncatchable runtime exception is generated, such as "Too Many SOQL Queries".

Filter by
Sorted by
Tagged with
-2 votes
0 answers
20 views

"Root entity queries"....could anyone clarify my doubts

more than 1 level away from the root entity object. Try to find it when we will get this error and write a error query...can any one explain
user avatar
  • 1
1 vote
1 answer
21 views

Rest API - Which has higher priority in a SOQL query, LIMIT clause OR Sforce-Query-Options: batchSize?

When a SOQL query has both a LIMIT clause and a Sforce-Query-Options: batchSize with different but valid values, which one of these gets a higher precedence? A query with only LIMIT clause SELECT ID ...
user avatar
0 votes
0 answers
16 views

Record triggered asynchronous flow vs Maximum number of methods with the future annotation

I have a scenario related to a potential issue we are facing in an org. An autolaunched flow executes once and loops 51 times through a create record element which creates 1 single record in each ...
user avatar
  • 1
1 vote
1 answer
36 views

Apex query rows limit reached according to log limit, but not sure about it

I have a LWC and I make a call to an apex method. Depending on some filters, the queries return a different ammount of records, but on some scenarios, the limit of rows is reached, but the number of ...
user avatar
-1 votes
0 answers
19 views

Confused with Database.Querylocator limit [duplicate]

I've gone through the apex governor limits doc and got little bit confused about below limits. Total number of records retrieved by Database.getQueryLocator - 10000 Maximum number of records returned ...
user avatar
  • 23
-1 votes
1 answer
44 views

API limits and how many concurrent API requests Salesforce can process

Just wondering if there is any limit to concurrent API requests into Salesforce. We are beginning to expose Apex REST endpoints for external systems to call. We know we have a 24 hour API limit, where ...
user avatar
1 vote
1 answer
48 views

Exposing an Apex REST API service - running into limit issues

We are trying to expose a service in Salesforce using Apex that external systems can call. This service is pretty simple. We will run a query against an object and create a response that returns an ...
user avatar
3 votes
0 answers
113 views

How to send Case Emails to Users via Apex

Note: this question has been significantly edited after I discovered a new, more immediate issue with this scenario. My use case: A Case may be created via Internal User, Community User, or Email-to-...
user avatar
  • 10.9k
0 votes
1 answer
58 views

Some queries under a sustained load of `N` QPS fail due to an INVALID_QUERY_LOCATOR error

I have a query with limit specified as 500 (user can request a max of 2000 records). Unfortunately Salesforce, doesn't return the results in one go, but divides the results into multiple pages and ...
user avatar
2 votes
1 answer
54 views

Flow - limit exceeded

I'm trying to create a flow that will create 70 child campaigns with 40 leads in each(2800 leads are stored in parent campaign) It says that my organization has exceeded the maximum limit for this ...
user avatar
1 vote
0 answers
39 views

Does each chunking of a batch goes through the same process of Queued, Processing and Completed states?

As per documentation : The maximum number of asynchronous Apex method executions (batch Apex, future methods, Queueable Apex, and scheduled Apex) per a 24-hour period For Batch Apex, method ...
user avatar
-2 votes
1 answer
43 views

Can anyone write this code in optimized way?

I know it's not the correct way to write the code like this. But can anyone help me to optimize this code without for loop? String userName = 'test@test.com%'; List<String> objectNames = ...
user avatar
0 votes
1 answer
46 views

Collection size 1.079 exceeds maximum size of 1.000

I create a very simple query to display the result at visualforce and render as pdf to store the pdf in an account. Unfortunately I ran always into Collection size 1.079 exceeds maximum size of 1.000 ...
user avatar
  • 83
1 vote
1 answer
39 views

Why CDC has all Sync Limits being an Async process?

According to Salesforce documentation. You can add up to 50 jobs to the queue with System.enqueueJob in a single transaction. In asynchronous transactions (for example, from a batch Apex job), you ...
user avatar
-2 votes
1 answer
75 views

Considering governor limits when coding a LWC with callouts

Let's say that we are supposed to design a LWC that would: Show a list of items which would be returned from a Web Service (LWC is rendered, callout is automatically made, JSON array of objects is ...
user avatar
0 votes
0 answers
38 views

Retrieving number of child records of a parent in the most efficient way possible

Is there an efficient way of finding out how many of each child record a parent record has without doing a SOQL query on each child object? What I want is something like the information shown in the ...
user avatar
0 votes
2 answers
84 views

ConcurrentPerOrgLongTxn Limit exceeded. Does SOQL query and Apex Callout timings gets counted

Apex CPU Time limit: Here Query timings and Callout timings does not get counted. But would SOQL timings and Callout timings contribute to ConcurrentPerOrgLongTxn ? We started hitting ...
user avatar
0 votes
2 answers
76 views

Database class partial success can exceed governor limits?

I have a question about the partial success using database class. My question is, if i exceed governor limits. Will the whole transaction be rolleback or i'll have in the database the records that ...
user avatar
1 vote
1 answer
51 views

what would be the best way to insert bulk data to a custom object

I need to make 2 calls per day to API Rest and process the data. I have used “apex scheduler” to automate the 2 calls a day, then call to my apex class where I have all the logic to call the ...
user avatar
0 votes
1 answer
64 views

How to build large single XML Document over multiple batches

I would like to understand if it's possible to generate large XML files using XmlNode and Document classes in Batch apex? Ideally, I would like the Dom.Document class variable to be stateful. However, ...
user avatar
  • 616
0 votes
1 answer
110 views

What's the most efficient way to generate XML using apex? [closed]

Im currently using XmlNode and Document classes in apex to generate XML from sObject records. It works great for low volumes (up to 1000 records). However after that, I get CPU timeout. I can't see a ...
user avatar
  • 616
3 votes
2 answers
153 views

Does Platform event subscription applies to PE Triggers too?

Consider this scenario. I have a trigger on Platform event named as SOject_Upsert_Data__e trigger SObjectUpsertData on SOject_Upsert_Data__e (after insert) { // Some Logic } And I am raising ...
user avatar
2 votes
0 answers
20 views

What contributes to DailyDurableStreamingApiEvents Limit [duplicate]

We appear to be using a high % of the limit of DailyDurableStreamingApiEvents. What is this Salesforce limit and what sort of things contribute towards it? (Do normal Platform Event triggers ...
user avatar
4 votes
1 answer
81 views

Subqueries in soql for loop vs standard soql queries

I have 26 accounts and 24 contact records in the org and running a SOQL query on them (fetching Accounts along with contacts). Found that if SOQL for loop is used then the child records fetched in the ...
user avatar
  • 193
1 vote
1 answer
94 views

Batch Apex Uncatchable/uncaught exceptions

I had understanding that if batch apex execute method encounters an uncatchable/uncaught exception, then it stops the batch processing at that particular execution of execute method and does not ...
user avatar
  • 304
0 votes
1 answer
63 views

After update Trigger to avoid hitting governor limits

We have a custom object(Request__c) with lookup to PersonAccount(AssigneeAccount__c) and Account(BusinessAccount__c) similar to AccountContactRelation(ACR) standard object. There is a requirement ...
user avatar
  • 167
0 votes
0 answers
33 views

How to avoid governor limit while reading and deserializing a json attachment more than 4MB

I have a JSON attachment on ContentVersion object with the file size of 4MB, While trying the read the file and prepare the data for the custom report using lightning component it reached HEAP limit ...
user avatar
0 votes
2 answers
362 views

Getting error System.AsyncException: Future method cannot be called from a future or batch method: when I am calling future method from a trigger

When I am calling future method from a trigger then I am getting error USER_DEBUG caused by: System.AsyncException: Future method cannot be called from a future or batch method: ExampleFuture....
user avatar
  • 101
0 votes
1 answer
55 views

Re-Parenting in a loop

I need to update another developer's code that is running up against the Apex CPU limit when dealing with a large number of accounts. The code itself fired on afterUpdate trigger on the Account ...
user avatar
  • 21
0 votes
1 answer
21 views

What are the per hour or per day governor limits for a managed package app ? are they different from unmanaged apps?

I am developing an app which I plan to publish via App Exchange. The majority of feature of this app will be through HTTP callouts , and these can go in the range of thousands. So what I need to to ...
user avatar
  • 1
0 votes
1 answer
123 views

How to process large volumes of records with callouts?

My client needs to import PDFs from Dropbox, match them to an invoice (where filename without suffix = field reference on invoice object), and attach to the appropriate invoice, then move the Dropbox ...
user avatar
0 votes
0 answers
13 views

App build on top of Salesforce : scaling and performance

Those in dev and QA working on SF app built on top of SF, How you do check and make sure that code is able to handle the scaling and performance and apex limits and callouts limits and all. do you ...
user avatar
  • 1
1 vote
1 answer
159 views

Too many SOQL queries: 101 in salesforce scheduled flow

I have created a scheduled flow to update parent account on accounts based on a criteria but there is SOQL 101 error since trying to query the parent account inside the loop not sure how to resolve ...
user avatar
-3 votes
1 answer
156 views

Salesforce limit for concurrent calls of Async Apex

What is the limit of max concurrent calls for Batchable apex Queueable apex Future methods Need the Limit for both the scenarios 1. Limit for running the same batch (with different transactions), 2. ...
user avatar
11 votes
2 answers
290 views

Is it possible to get a Custom Setting without the cost of a SOQL query and at the same time do it DYNAMICALLY without hardcoding the setting?

Once I had the illusion that accessing custom setting is always free and does not consume any governor limits. Until today: I've learned the hard way that this is only half-true. It is true, that this ...
user avatar
  • 33.5k
4 votes
1 answer
195 views

Platform Events- Event Delivery Limit for Simple Use Case

Trying to solution for the following use case: A desktop softphone Salesforce Classic Visualforce Page On call received on desktop softphone, pop in user's classic SF console. Created platform Event ...
user avatar
  • 1,808
1 vote
0 answers
91 views

Get 10+ level category hierarchy relationship

Needs to get the category hierarchy from top to bottom Which mean we have c1 code from c1 needs to get c1-->c2-->c3-->c4--> etc,. I have an 'category' object it stores all the category ...
user avatar
  • 35
-3 votes
1 answer
49 views

Batch apex : Frist error Apex CPU time limit exceeded [closed]

I am getting CPU time exceeded error for my batch class. I have 187,000 records to query on and I want to delete all the records. I am using below query in start method. global Database.QueryLocator ...
user avatar
0 votes
1 answer
82 views

Database.executebatch call in for loop causing Codescan warnings

I have a piece of code that is causing some codescan warnings and it is not liking the database.executebatch in the for loop. The thing is I am not sure to go around it My code: public with sharing ...
user avatar
  • 225
4 votes
1 answer
154 views

Penalties? - Code ran in seconds yesterday, today it times out

In the context of my previous question on how to "Discover Schema of Source + Metadata XML formats" I have found a great library to do simple XPath in Apex. Running this query on 1 MB ...
user avatar
1 vote
0 answers
34 views

Too many soql queries when trying to create a json packet for customers with Active orders

I'm trying to port over my code below to production but continue to get System.LimitException: Too many SOQL queries: 101. @RestResource(urlMapping='/my_endpoint') global with sharing class ...
user avatar
  • 11
0 votes
1 answer
99 views

Salesforce Process Builder Apex Error: Too Many Future Calls

I've created an SalesForce Process that automates the creation of Asana projects for my org. This works well in small-scale, however when many data updates happen at once, we receive an error; Error ...
user avatar
1 vote
2 answers
184 views

Unable to escape the governor limits (Too Many SOQL Queries: 201)

My governor limits are getting exceeded because i need to use count() for each individual fieldName and check fieldName != null, and return it's individual value But there are over 300 fields, how to ...
user avatar
  • 1
0 votes
1 answer
85 views

How would I resolve a 429 error that does multiple api callouts from a scheduled class that calls multiple instances of a Queueable class

I have a scheduled class that calls a Queueable class which does an api callout. What seems to be happening is once the scheduled class is done setting up all of the queueable classes to run, they all ...
user avatar
  • 13
0 votes
0 answers
37 views

How to catch exception if flexQueue is full when using System.scheduleBatch

What happens to a batch class which is scheduled to be executed by System.scheduleBatch(batchableClass, batchClassName, 1, 50); The batch class gets scheduled as a Schedulable Job after a minute. ...
user avatar
-1 votes
2 answers
50 views

Help Needed to Bulkify Scheduled Apex Class PLEASE

Hello awesome Developers, I have the following scheduled apex class that I plan on running nightly or possibly a few times a day. The purpose of this scheduled class is to replace the standard ...
user avatar
  • 53
0 votes
0 answers
115 views

FSL Trigger Exceeding Apex CPU Time Limit

I am attempting to integrate Salesforce using some middleware.  What the integration does it take an Excel sheet, and from that sheet create a Work Order, Service Appointment and Assigned Resource ...
user avatar
0 votes
1 answer
64 views

Documentation for Singleton in Salesforce has incorrect information

I was reading through the documentation in salesforce for using a singleton pattern and it is mentioned. Limiting Impact of Governor Limits - certain system objects and methods, such as Apex ...
user avatar
1 vote
1 answer
543 views

Governor Limits related to SOQL in Apex code for Child Query

I am checking the governor limits of SOQL queries and just want to confirm few things: When we have more than 200 records related to 1 account I am getting exception as : System.QueryException: ...
user avatar
1 vote
1 answer
191 views

How to count email invocation in @future method ? Limit check after Test.stopTest is returning 0; [duplicate]

I can't understand why I am getting 0 from Limits.getEmailInvocations(); that is run after Test.stoptest(). The method which is sending emails is @future annotated and run from trigger handler on ...
user avatar

1
2 3 4 5
16