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
2answers
40 views

Before Insert Trigger SOQL Limits

I am building a before insert trigger on hed__Program_Enrollment__c. What I am trying to do is delete everything in the hed__Program_Enrollment__c table based on a certain condition and this seems to ...
0
votes
0answers
18 views

Refactor formula to avoid exceeding character limit

I have the following formula field: IF(AND(TEXT(Method__c)="FedEx Ground", Residential__c = TRUE),"GROUND_HOME_DELIVERY",IF(AND(TEXT(Method__c)="FedEx Ground", Residential__c = FALSE),"...
0
votes
1answer
80 views

Too many callouts 101

I am making a callout to a webservice to retrieve records and upsert them into Salesforce. When I execute my batch class with a small set of records, they're inserted in Salesforce properly. However ...
1
vote
1answer
76 views

Batch Job Governor Limits

We have two custom objects - obj1 and obj2. These are related by a custom Id. We need to iterate through obj1, get its relevant records from obj2 based on Id and further query for permission of each ...
0
votes
1answer
24 views

API Request Limits

I have read the article: https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_api.htm Can someone, ...
6
votes
2answers
155 views

Current state of reliable execution scheduling

A number of approaches to more reliable scheduling and continuous processing have been used over time on the Salesforce platform, all of them suffering from serious drawbacks. These include: suicidal ...
0
votes
0answers
33 views

How to add cc & bcc in Messaging.SingleEmailMessage Email and simultaneously avoid single Email limit being hit

My requirement is to send single email with To/Cc/Bcc added. All the email Ids belong to internal users. Initially, when I was passing the User.Id to these methods, I was hitting the Single Email ...
1
vote
0answers
30 views

DLRS making too many queries to its own object

Our org is using real-time DLRS fields on a few custom objects related to a custom sales order management implementation. The fields are basically there to summarize order total when order items ...
0
votes
1answer
44 views

Aggregate Query on 900K records - how to do this?

Hello fellow developers, I need to run an aggregate query on 900K telephone records to add up a field (grouping by phone line id) and record results in the "summaries logbook". I have tried ...
0
votes
2answers
36 views

app exchange managed package computational cost

A managed app published in AppExchange by Vendor A. Customer A installs this managed package in his Salesforce org. When customer A excutes this managed app in his org, Will the Vendor A be charged ...
0
votes
0answers
32 views

Flow Using more than Object

Trying to build a flow that used GET RECORD to pull a filtered list of Opportunities, and use the AccountIds from these Opportunities to update a list of Accounts. The only way I have achieved that ...
0
votes
0answers
13 views

REST Endpoint vs sobjects Endpoint

I want to get my understanding right on API Limits. Currently to update an object from an external application we are hitting the below endpoint. /services/data/v44.0/sobjects/CustomObject__c/...
0
votes
1answer
21 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[...
2
votes
2answers
61 views

Flow Hitting Governor Limits

I have an issue with the following flow : I have a field source on contacts populated automatically by an external Id. Partnership is a custom object on which I can set another source field. When ...
2
votes
1answer
36 views

Get Children Records out of Loops in Flows

Dear StackOverflowers, This is my first question on SO, so please bear with me if you find it naive. I have looked up and down the platform and surprisingly, I haven't been able to find a similar ...
0
votes
1answer
31 views

Salesforce - Talend Integration: API limits

We have created a API only user in our org, and are using Talend job (auth through this user) to login every 5 min and checking for any new opportunity created. If yes, then that opportunity is ...
0
votes
0answers
33 views

SOQL Count query on large number of records

I am attempting to run a count query in workbench(and dev console). I am simply trying to count the number of records within the object(with 2 where statements). My estimation is that there is ~28 ...
0
votes
1answer
42 views

How to BULKIFY my code? [duplicate]

I am having a really hard time bulkifying my code, and need to do so becasue I am reaching the SOQL limit on execution. Here is my code as of now. public class Zenefits_Time_Off implements ...
1
vote
0answers
32 views

SOQL 101 issue, Need help in trimming Trigger code

I have the following trigger which is possibly a culprit to cause this SOQL 101 issue. I am not an expert so not see what is wrong here, so I need an expert to advise and suggestions where I have ...
0
votes
0answers
35 views

How to design solution for querying 200k+ records and using that inside LWC?

I have a problem statement where I need to design an LWC component to enter policy information and check if that policy already exists in the system and print a report of those that aren't in the ...
1
vote
2answers
24 views

Single Email Limit Exceeded

I am hitting an apex error in production: "SINGLE_EMAIL_LIMIT_EXCEEDED". I have unit tests in production that run when I do the deployment that call methods as part of the test that send out email ...
0
votes
1answer
22 views

Avoid governance limit for bulk-assign a large number of records to unique contacts

Let's say I have a generic "container" record that is used to store JSON responses from third-party API's. These Container records have a single field 'data', which is a JSON string identifying ...
2
votes
2answers
71 views

CPU time limit jumps from 2000 to 14000 after a trigger ends

Hi I am having trouble with the Apex CPU time limit. I've optimized my code as much as I know how to, but when my trigger finishes running it goes from 2000 to 14000. Does anyone know what else is ...
0
votes
1answer
35 views

Need work around for salesforce limitation when making callout

I have searched but i didn't get how to fix this issues Actually I'm making callout to Google Vision Api from salesforce apex class. When i m uploading image with more text content, response from ...
0
votes
2answers
45 views

How to implement Apex Batchable properly, need to update ~5M records

I need to update CampaignMember, the value that I need to insert is in Opportunities, but there are more than 4 Million records, I was using Jitterbit and Excel to do this, but is very difficult ...
0
votes
0answers
18 views

Salesforce grouping execution flow

Is possible Salesforce be agroupping the Lighting flow execution? We are working with Platform events calling a specific Lightning flow each time it runs, and we noticed the flows are being executed ...
0
votes
1answer
52 views

Calculating getDmlStatements

I am wondering how I can calculate DMLStatements. The test below adds unexpectly 3 instead of 1 -> after insert. Why? System.debug( Limits.getDmlStatements( ) );//0 Account ac = new Account( Name = '...
0
votes
0answers
154 views

How to debug the error: 'Apex CPU time limit exceeded'

The trigger written in my salesforce org is hitting the apex cpu time limit . Hence I am trying to optimize apex code and reducing the workflow updates. But below log is confusing me about the apex ...
0
votes
1answer
42 views

Trying to update records by scheduling an apex class. However, I'm getting CPU Timeout Error with the code below. Am I suppose to use maps?

List<Deal__c> records = [ SELECT Name FROM Deal__c WHERE CloseDate__c < TODAY AND RecordType.Name = 'Franchise' AND (StageName__c != 'Servicing' OR StageName__c != 'Closed Lost') ]...
0
votes
1answer
69 views

Reaching Connect API's hourly request limit for this user and application?

I`ve got this type of error during the work in Lightning Community: You have reached the Connect API's hourly request limit for this user and application. Please try again later. My API Requests ...
0
votes
1answer
23 views

How to bypass read timed out error while making callouts?

I have been trying making a request to Amazon Web Server, to send a document. In the request header, I am required to set a header named, Content-Length, which is currently being set to the BodyLength ...
0
votes
2answers
34 views

Get the number of SOQL calls in manage package

My org has a manage package installed. Is there any way to detect how many SOQL calls it has done in apex? I have code that fires because of it. Once a certain number of SOQL calls have been attempted ...
0
votes
2answers
89 views

How do I see limits associated to REQUEST_LIMIT_EXCEEDED: TotalRequests Limit exceeded

After using sfdx force:source:deploy a good amount today to deploy to production (see how to here), I hit the following error: ERROR running force:source:deploy: REQUEST_LIMIT_EXCEEDED: ...
0
votes
1answer
159 views

System Permissions Assigned to Permission Set

Is there a SOQL/SOSL to export/FETCH only the System Permissions from a Specific Permission Set in Salesforce.
1
vote
2answers
47 views

Limit on Batch class

If I run a batch class every night, that goes over 10000 leads every night and updates a field. Would I get the limit exceeded error considering the huge number of records?
2
votes
1answer
103 views

How do SOQL queries act in Queueable (async) apex?

I have a set of 4 Queueable apex classes that perform an ordered series of tasks on a large number of records. It queries a limited number of records, modifies them so that they no longer meet the ...
2
votes
2answers
121 views

Journey Builder Salesforce Data Event and APEX Governor Limits

We use Salesforce Data Event as journey entry source and we now have a requirement to do a bulk upload of contacts to Sales Cloud and inject all of them into a running welcome journey. Could someone ...
0
votes
1answer
41 views

Why isn't my Queueable chain working?

I have the following class, none of the dependencies invoke Queueable: public class TEST_SandboxDataFactory { public static void create() { List<SObjectType> sObjectTypeList ...
1
vote
2answers
330 views

The 50,000 row query limit is not actually a “per APEX call” as widely believed

I recently ran into a strange issue with the 50,000 row query limit that had me puzzled due to the belief that the 50,000 row query limit applied only per-call. This realization occurred while ...
2
votes
4answers
73 views

See Number of Queries Executed in Call-chain

I have an Apex Controller that is sporadically bumping up against the SOQL Governor limit when executing some functionality. The functionality does some queries and updates some values which executes ...
9
votes
1answer
216 views

How to determine Platform Event Size in Apex to ensure to be within < 1 MB

The documentation on Platform event states: The maximum event message size that you can publish is 1 MB. Is there a native and reliable way in Apex to check whether the Platform Event I am about ...
1
vote
1answer
31 views

Many platform events per transaction and affect on Heap

Given 100 platform events published for Foo__e in the same second Each platform event represents 100K of data (10MB data altogether across the 100 events) When SFDC presents the events to the ...
3
votes
1answer
48 views

Optimizing Process Builder: Early Exit: Worthwhile?

Given An asynchronous transaction receives Json payload that is transformed by Apex into Assets. Process Builder on Asset with a dozen decision blocks, none of which are ever true for the inserted ...
15
votes
1answer
148 views

Does data referenced from the Platform Cache consume heap space?

Reading Platform Cache Limits, it appears that an individual request can obtain up to 1 MB of data from the Platform Cache: Maximum local cache size for a partition, per-request 1,000 KB ... ...
2
votes
2answers
91 views

Find record diff between two dates in Apex (to minimize API calls)

I have a managed package app with a CustomObject__c where some of its fields need to be "synced" with an external web service. To stay within technical limits the Sync callout is only done once a day. ...
3
votes
1answer
36 views

Access governor limits values for managed package via Apex

So the system class Limits is available to get the number of any limits against an org. For performance tuning and logging perspective, is it possible to get the Limits for an installed managed ...
2
votes
2answers
339 views

Apex Sleep: what is CPU penalty

As we know (as of V46), there is no apex sleep method. Various workarounds have been proposed such as doing a callout to a service with platform support for sleep but this makes unit testing ...
0
votes
2answers
124 views

How to bypass Governors limit when inserting more than 10000 records from the execute method of a Apex Batch

Edits : Adding the code snippet here for review global class Agg_Batch implements Database.Batchable<sObject>, Database.Stateful, System.Schedulable { global Agg_Batch() { //...
0
votes
1answer
21 views

Load Testing For email Sending within a Batch

I wondering if there are any tools that I can use for Load Testing. I have a 2 batch : Batch A Bacth B Which both of them using the Database.Stateful and I'm calling Batch B from Batch A's finish ...
0
votes
1answer
145 views

CANNOT_EXECUTE_FLOW_TRIGGER - System.LimitException: Too many query rows: 50001

I have an apex class that was written by a previous SF Admin and I'm trying to understand why it isn't working. From what I can tell, it is supposed to auto-populate the Account Name that is ...