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
1
vote
1answer
41 views

Why the oficial docs recommend to use Flows over Apex Triggers, if handling the Governor Limits is nearly impossible when the App grows?

Even if you follow the guidelines and keep one PB for sObject and so on, you'll be probably sooner or later having to refactor the (probably quite big) PB, to an Apex Trigger. So why the docs ...
0
votes
1answer
40 views

Will the following code hit governor limits?

trigger CaseTriggerOperation on Case (before insert) { for (Case caseObj : Trigger.new) { List<Case> caseList = [SELECT Id, ContactId ...
0
votes
1answer
37 views

Choose async or sync based on amount of data returned or trigger size?

Can anybody guide me through any framework which I can refer in order to achieve this use case?I am not able to get my head around it on how to do it efficiently. I want to process records in near ...
2
votes
1answer
61 views

Insert with Throw Exception

In the code below: try { //code here } catch (Exception e) { Account a = new Account; insert a; Throw new Exception ('test') } Apparently on Platform Event objects, executing the command: ...
1
vote
2answers
34 views

Queueable being called from a trigger by an Asynchronous Process

Recently we moved our logic in our trigger to be asynchronous and now the helper method that the triggers call looks something like this (specifics obfuscated since it's company code): global static ...
1
vote
1answer
45 views

API Inbound and Callout limits SOAP vs REST

I am having trouble finding a clear answer or multiple sources to this question regarding calling the Salesforce API's (inbound) and making callouts from Salesforce. See page 40 in this doc In the ...
0
votes
1answer
25 views

How to achieve Asynchronous Apex with Aura Components? (NOT Callouts)

I have a working Aura Application with a requirement of showing heavy data inside of many lightning datatables based on the LoggedInUser. It works fine for majority of the users but for few, the data ...
0
votes
1answer
30 views

Considerations on Recordtypes

Salesforce claims that there should not be more than 200 recordtypes in an org. It cites that this can be difficult for people to manage. Is this due to limitations they run into on Salesforce, or is ...
0
votes
1answer
18 views

Outbound XML Payload and Heap Governor Limits

Greetings my fellow SF Experts, I have a massive outbound XML integration that I need to build in salesforce (Multiple XSD schemas with several thousand lines of xsd elements). Waiting for official ...
0
votes
1answer
35 views

The Query Cost of UPSERT

In an Apex Test, I'm getting the 'Too many SQL queries: 100' error. Quite a lot happens in the code that is called (it's an API endpoint, not just a single function) and in one scenario, the end point ...
0
votes
1answer
65 views

Governor Limit Hit ( Issue with code inside the for loop)

I created a trigger to call a apex code (Before insert, Before update). The process is basically initiated when a referral record is created, i used some fields from referrals to do a look up for a ID ...
0
votes
2answers
49 views

Using future method in triggers [closed]

Trigger batch size can be 200. If i call future method(callout=true) on every batch object, this will throw limits error or not? If it throw, how can i avoid this?
0
votes
0answers
17 views

System.LimitException: Too Many SOQL Queries: 101 in Campaign memeberTrigger [duplicate]

I am getting error message "System.LimitException: Too many SOQL queries: 101" and I believe it to be error with this trigger. I am new to coding and this was done previously so any ...
1
vote
1answer
17 views

Log indicates I am going over Query row limit but only pulling 153

I was hoping someone could give me some insight on why this is failing. I think it's because the Master Inventory Object is over 300 thousand records but the thing is I'm never querying even close to ...
0
votes
0answers
22 views

How to determine the data category of a knowledge article after initial query?

I have a requirement where I am supposed to attach knowledge articles to records based on their record types. This process must be as bulkified as possible. So let's say I start with the following ...
0
votes
1answer
34 views

Writing efficient code

I would like to understand the difference between snippet 1 and snippet 2. In snippet 1 I get a DML rows limit exception whereas in snippet 2, I don't get any exception. What makes snippet 2 not throw ...
0
votes
2answers
35 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 ...
2
votes
0answers
28 views

Options to store Large Configuration Data in an AppExchange Managed Package

We have an AppExchange App which needs to connect with an external application via API Calls. API calls need to happen in individual user context and not in a single Integration User context. This ...
0
votes
0answers
34 views

Simple triggered Flow, but still “flow Error Occurred: Too many SOQL queries: 101”

I have a really simple flow no loop, two update elements. I get the error: Error element Update_Account_Owner (FlowRecordUpdate). This error occurred when the flow tried to update records: Too many ...
0
votes
1answer
15 views

Are there any limits on the number of blocks that can be used in a flow?

Are there any limits on the number of blocks that can be used in a flow? Thanks in advance
1
vote
1answer
36 views

Chaining Flows / Process builders and governor limits

We have one large process builder on the lead object which is critical for several business processes. The challenge we're facing is that multiple devs modifying the PB in the same sprint is making it ...
4
votes
1answer
47 views

Alternate of Protected Custom Settings In an AppExchange Managed Package for Large Configuration Data

We have an AppExchange App which needs to connect with an external application via API Calls. API calls need to happen in individual user context and not in a single Integration User context. This ...
-1
votes
1answer
43 views

How to bulkify my code in a better way? [duplicate]

I’m learning on how to code in Apex, and I’m trying to figure out how I can bulkify my code in a better way so that I won’t get SOQLExceptions. Scenario: Whenever I upload a lot of records using data ...
0
votes
1answer
19 views

Which limits are likely to affect a bulk SingleEmailMessage transaction?

We wrote a custom campaign function that sends individualized emails in one large SingleEmailMessage list. I'm wondering how to estimate its scalability versus limits, particularly CPU and Heap Size. ...
0
votes
0answers
29 views

Apex Heap Size and Variable Scope [duplicate]

I run the following code in the anonymous apex window. As you can see the accounts variable was declared inside an IF block. I output a debug outside of the IF block and the heap size was still ...
2
votes
0answers
123 views

Live Agent REST API Daily Limits

We are planning to use LiveAgent REST APIs from an external Application. Details of APIs are available in below link: https://help.salesforce.com/articleView?id=000331168&type=1&mode=1 The ...
0
votes
1answer
16 views

Contact Record Limits

We are working on a new implementation and have 5 million contacts in our existing database. What do I need to consider before migrating those over? I do not plan to use much salesforce reporting. ...
0
votes
1answer
36 views

Does authenticating against oauth2/token endpoint count towards API Request Limits?

Does authenticating against endpoint: Instance URL + /services/oauth2/token Count towards API Request Limits?
0
votes
0answers
23 views

“Unable to Process Request Concurrent requests limit exceeded”. Is there a way how can I overcome this error? [duplicate]

I have a scenario where an external system calls the SOAP webservice inside salesforce and it causes "Unable to Process Request Concurrent requests limit exceeded". Any thoughts or ...
0
votes
2answers
47 views

Help with SOQL Query to fetch all records with a combination of where and Limit

I am new to Salesforce . I'm faciing an issue to form a query to use it in a Apex class . Example Query : /*Set with all the LookupField__c lookup field id's */ Set<Id> LookupField ...
0
votes
1answer
57 views

Is it possible to update the same field in same object for multiple updates in the same batch class

Please let me know is it best practice to update the same field with different status for the same object in same batch class global void execute(Database.BatchableContext BC, List<SObject> ...
0
votes
2answers
37 views

How can I show a custom error message in a visualforce page in place of the governor limit

The page has a column called Name which searches account. It is throwing the error Too many query rows: 50001 Error when users we do not search with full name.
1
vote
1answer
80 views

Lightning component transaction context for SOQL queries

Do Lightning Web Components operate in their own transaction when it comes to SOQL query limits? For example, if I have a Lightning Page with several LWCs, can I focus on each LWC as a single entity ...
1
vote
1answer
41 views

Apex Execution event log shows test methods and sub five second transactions being marked as long running

In the org I work in we've been having issues with the concurrent apex limit. For context, specifically this limit. Number of synchronous concurrent transactions for long-running transactions that ...
0
votes
1answer
141 views

What is the Difference bw the Maximum CPU time on the Salesforce servers(10 second) and maximum execution time for each apex transaction (10 minute) [duplicate]

What is the Difference between the Maximum CPU time on the Salesforce servers(10 second) and maximum execution time for each apex transaction (10 minute) ?
0
votes
1answer
21 views

Task Trigger fired for one record after email send

I just learned in a very painful way that when sending SingleMessage emails tagged to be saved as activity the task trigger is called for each single message at once not in bulk. I'm sending from ...
8
votes
1answer
327 views

How do I bulkify queries for directly or indirectly related records?

This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through ...
0
votes
1answer
83 views

What is the maximum number of rows that can be counted by a SOQL count query?

I recollect that: select count() from Contact will now work for more than 50,000 rows (but can't find documentation on that improvement). My question is whether or not there is a new (much higher) ...
1
vote
1answer
44 views

How do I take out the DML statements out of the loop? [duplicate]

I am new to apex, I've achieved the basic working code of what I had to, in java. But now I am told that I cant do DML statements or queries inside loops. Any help/explanation as to how I could I do ...
0
votes
1answer
44 views

Is there is good way to send an email to a user after 5 minutes of inactivity on an Account?

An indeterminate number of images will be attached to Lead records. We have a requirement that 5 minutes after the last image is attached, the Lead owner should automatically receive an email. I've ...
0
votes
1answer
56 views

Do queuables break inserts up to avoid 101 SOQL Limits?

I have a case comment trigger that queries data based on the trigger.new using IN. Ex: SELECT Id,Type FROM Case WHERE Id IN:caseIds where caseIds is a list of parentIds of the CaseComments being ...
0
votes
1answer
48 views

Are emails sent from Apex recorded anywhere?

I am trying to determine the frequency of Apex emails to troubleshoot a limit issue I can't find references to the emails sent from Apex (Messaging.sendEmail / Messaging.SingleEmailMessage) neither in ...
1
vote
1answer
115 views

How to Optimize SOQL Query when I have 15 million Account records?

I have a use case where I am exposing a custom Rest service that would accept phone# as an argument and compare with the five phone# fields on Account and would return the single record matching ...
2
votes
1answer
55 views

Prevent limits in a callout intensive process where client can only receive one request at a time?

I have a callout intensive process where the client can only receive one request at a time and I'm having a hard time identifying what is the best practice for asynchronous solutions to handle this ...
1
vote
1answer
90 views

Limit on Total Number record to upsert :: Too many dml rows

Salesforce docs says: "Each upsert statement consists of two operations, one for inserting records and one for updating records. Each of these operations is subject to the runtime limits for ...
6
votes
0answers
96 views

SOQL Aggregate functions circumventing limits?

We're working in a managed package that leverages SOQL aggregate functions and we want to ensure we are considering governor limits appropriately. To prepare for it we have created a Scratch Org with ...
0
votes
1answer
57 views

Limits on making outbound API calls from Salesforce org

I am wondering if there is any Salesforce system limit regarding the number of outbound (i.e. towards other systems) API calls that can be made from an org. I am aware of all of the concurrent and 24h-...
0
votes
1answer
194 views

Why do I still get System.LimitException: Too many SOQL queries: 101 when using Data Import Wizard?

Even when I untick the "Trigger workflow rules and processes for new and updated records" in Import wizard, I still get this error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY:CE_InputTrigger: ...
0
votes
2answers
25 views

Best way to convert SOQL when doing an import of data

I was wondering what would be the best way to convert the below code ,which is importing price book entries, so it doesn't hit the governor limits. for (Integer i = 1; i < csvFileLines.size(); i+...
0
votes
2answers
32 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))){ ...

1
2 3 4 5
15