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
0
votes
1answer
25 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 ...
0
votes
1answer
54 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 ...
0
votes
0answers
18 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 ...
0
votes
2answers
33 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....
0
votes
1answer
50 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 ...
0
votes
1answer
18 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 ...
0
votes
1answer
108 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 ...
0
votes
0answers
11 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 ...
1
vote
1answer
52 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 ...
-3
votes
1answer
54 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. ...
11
votes
2answers
213 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 ...
4
votes
1answer
68 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 ...
1
vote
0answers
60 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 ...
-3
votes
1answer
35 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 ...
0
votes
1answer
64 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 ...
4
votes
1answer
151 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 ...
1
vote
0answers
32 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 ...
0
votes
1answer
66 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 ...
1
vote
2answers
125 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 ...
0
votes
1answer
43 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 ...
0
votes
0answers
29 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. ...
-1
votes
2answers
49 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 ...
0
votes
0answers
66 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 ...
0
votes
1answer
36 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 ...
1
vote
1answer
363 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: ...
1
vote
1answer
107 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 ...
0
votes
1answer
50 views

Question about Salesforce limits on API Callouts

I have to call a webservice from an external system each time a new record is created on Salesforce. The external webservice accepts a single record/object instance per callout. If I do an after-...
0
votes
2answers
113 views

CPU Timeout Error for 9k records after resolving Too many DML rows: 10001

What do I have? Two objects ObjectA and ObjectB without any trigger/process builder/flow. I create a trigger on ObjectA to create the same number of records on ObjectB What is my test case? Insert ...
4
votes
1answer
97 views

The Single Responsibility Principle vs SOQL Query/Row Limits

This question was asked similarly last month in Break single responsibility to save a soql call and was closed for being opinion based. The given use case also involved Queueable and so wouldn't ...
0
votes
0answers
84 views

Before-Save flow query limits

Since one of our main triggers has too many related processes, we are almost reaching the query limits. We have the idea to move some tasks executed in the before update context to a Before-save flow. ...
-4
votes
3answers
71 views

Derived query in SOQL Limits

Let's say we have a query SELECT Name FROM Account WHERE Id NOT IN (SELECT Id FROM Settings__c WHERE Group__c = 'Test') I know about 20K limitation but the question is - what is the limit for this ...
0
votes
1answer
34 views

How Can A Batch Transaction Be Executed From A Nested Loop To Update Variables In The Outer Loop?

How can we update a variable in an outer loop from a Batch transaction in an inner loop? For example, consider a example scenario where you must track the even Apples (per Basket) inside multiple ...
6
votes
1answer
171 views

Heap Size Optimization with commonly reused lists & variables

I recently joined a new, very large, very old org that is in need of optimization. Previously they had a tendency to create brand new, separate utility classes for each new method being called from ...
0
votes
1answer
161 views

Does governor limits apply for declarative tools like workflow rules, process builder and flow builder [closed]

If I have a trigger for a account object when record is created or updated using process builder how the trigger will work when bulk of records are inserted into the org.
0
votes
0answers
122 views

EncodingUtil.urlDecode method hitting the heap size

While uploading a file, we send base64 and urlencoded blob(3 MB size) to Apex. In apex method, while using EncodingUtil.urlDecode method, we are hitting the heap size limit. Below is sample code: @...
0
votes
0answers
24 views

Trying to query a limit of 100 orders that are broken up into multiple records based on the item

I need some assistance with creating a query that will get all the records that correspond to the first 100 orders. For example the table looks something like this: I know I can use GROUP BY grab the ...
0
votes
2answers
246 views

Batch job chunks calling queueable jobs transaction limit

This is a basic question instead of code related. I am writing a batch job which will update Application__c records. Trigger for Application__c object, enqueues a queueable job to update cases Batch ...
0
votes
2answers
55 views

how can I avoid a for loop when searching against a list in a picklist field

I need to search for a list of strings and match against a picklist field. So far, the query below only works when there is only one string in the query string. Appending more strings does not work ...
1
vote
1answer
52 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
44 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
68 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
95 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
136 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
335 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
154 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
33 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
45 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
81 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
67 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
443 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?

1
2 3 4 5
16