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 ...

learn more… | top users | synonyms (1)

3
votes
1answer
108 views

Deployment Test Failure - Too Many SOQL Queries: 101 but Query isn't in a Loop

First: I know this question has been posted many times so I apologize for making a new one, but I read over a lot of the old ones and they almost always seem to be that the SOQL query is inside of a ...
2
votes
1answer
19 views

Do roll up summary calculations count against the CPU limit?

Hopefully a straightforward question - if I insert/update/delete records into an object that is a detail of another object, does the server performing the roll up summaries count against the platform ...
2
votes
2answers
41 views

Good practice in querying very large data from different objects inside batch process

Good day everyone, I have created an apex class which will save data from csv to account and contact object in salesforce. The concept of this class is that it will read the column in my csv and will ...
0
votes
1answer
33 views

Avoiding too many query rows error while querying a very large data inside the batch process

Good day everyone I have created a batch process in salesforce. To explain more, below code is quite similar with my problem. public with sharing class AS_batchUpdateContactStatus implements ...
1
vote
1answer
26 views

Loading 1 million records using bulk API: Exceeding batch Limit

Whenever records are inserted in Contacts(usually inserted in 1000's), we have a batch job that checks related customer account in SFDC and populates the contact.accountId field and couple other ...
2
votes
1answer
23 views

Test Class Data Setup - Governor Limits

The test method gets its set of governor limits, exclusive of the content between startTest and stopTest. I have faced the issue of 101 SOQL Governor Limits in test classes and mostly I have been able ...
0
votes
1answer
40 views

Apex governor limit warning - no sign of hitting limit

I'm receiving the following email every time I view a case: Operation: /apex/caseTiming By user/organization: 005a000000BTWwZ/00D30000000omsI Caused the following Apex resource warnings: ...
1
vote
1answer
24 views

Callouts Bulkification in triggers

When an account is saved(update or insert) - I want to take its address and then find out the corresponding latitude and longitude from the google maps geocoding api and then save the latitude and ...
1
vote
1answer
36 views

Where are the SOQL hits coming from?

I've created an apex class that simply generates random data. we have created a sort of "checklist", similar to the todomvc project, which has checklist items and checklist assignees (contacts that ...
3
votes
2answers
44 views

How to know current Email governor limits?

I am using SingleEmailMessage api for sending emails. I want to know the email limit quota usage, so that I can prevent further exceptions. Is there any way to know the quota usage in apex, so that I ...
1
vote
1answer
48 views

What happens to a Scheduled Job if the Apex Flex Queue is full?

Given that the limit on the Apex Flex Queue is 100, what happens when it is time for the system to execute a Scheduled Job (of a Database.Batchable), but the Apex Flex Queue is maxed out at 100? Is ...
2
votes
1answer
62 views

Calculate the data size of a given object

I am evaluating the possibility of using the new Platform Cache to store reporting data for each of our franchise records. I could possibly use a custom object instead but for every data point I want ...
0
votes
1answer
29 views

System.LimitException: Too many SOQL queries: 101 & CPU time exceeded

I am getting the following two errors in various scenarios of running an apex class 1) Too many SOQL queries 2) CPU time exceeded The following is the only method in my controller class for ...
0
votes
1answer
35 views

BATCH Class - Inner Queries - Questions/Doubts [closed]

I am doing few thing in Batch - and I was curious whether : My SOQL Queries will work with 50000+ records ? Will my SOQL's take too much time to execute and cause Time Out, etc ? SOQL SELECT ...
2
votes
1answer
43 views

Bulkify SOQL with multiple date comparisons

I am just starting out with apex and learning about bulkifying queries but I bumped up across a query that I am not sure how to bulkify. What I am trying to do is return a Count of the number of ...
4
votes
1answer
244 views

Why does it say my SOQL for loop returned 50,001 records when it broke the loop after 20k?

I have a SOQL for loop wherein the query sometimes returns more rows than the limit of 50,000. The code block executes once per record returned by the query, and in that code block is an if statement ...
1
vote
1answer
48 views

Apex governor limit warning emails

I have VF pages linked to custom controllers which query thousands of organization records and display them. I get the following email Operation: /apex/SingleTicketAudit By user/organization: ...
1
vote
2answers
23 views

How to push Account changes down Account Hierarchy

I need to push some field updates, down to all the hierarchy of accounts. I created a flow, which goes over all accounts with the parentId I need Step details: I auto-launch this with a ...
5
votes
1answer
67 views

Testing Recursive Queueable Class

I have an Apex class that implements the Queueable interface which is used to remove custom objects attached to a set of Account Ids, and then inserts new custom objects to replace them. The volume ...
-2
votes
2answers
80 views

Too Many Query Rows 50001 - even with limit

I'm getting a "Too Many Query Row 50001" error even if I have a limit of 1000. Want to know what I'm doing wrong or clause I am missing. public Task[] getListTasks() { List<Contact> cntct = ...
2
votes
1answer
111 views

Limits.getDMLStatements() / Limits.getLimitDMLStatements()

Can anybody explain me the diff. and why I'm getting the following results Limits.getDMLStatements() = 2 and Limits.getLimitDMLStatements() = 150 List<Account> acc = [SELECT Id FROM Account ...
2
votes
1answer
217 views

How to SOQL query contacts by phone number when there are more than 100,000 contacts

I am receiving a System.QueryException when searching for contacts by phone number in an APEX class: An error occurred at element myRule_1_A2 (FlowActionCall). An Apex error occurred: ...
7
votes
1answer
94 views

How to debug hitting CPU time limit

We have a very slow save happening in Salesforce. Most of the time it succeeds, but is probably just under the CPU limit. If I enable debugging, then the overhead associated with debugging causes it ...
1
vote
1answer
66 views

How SOQL For Loop instead of SOQL may solve System.LimitException: Too many query rows: 50001?

I have two custom object, Master__c and Detail__c. There is lookup relationship on Detail__c to Master__c ( since some Detail__c record may not have a master ). To calculate total count field on ...
1
vote
2answers
49 views

HTTP Request contributes to what limits on force.com platform?

There's a per-apex-session limits which HTTP Request, like how many request can be issued inside one apex session, in total how much time the http request can spend. Besides those, what else limits ...
2
votes
2answers
29 views

Heap size error when cloning FeedItem of type “ContentPost”

We are migrating our managed software from ObjectA to ObjectB. I want to move (via cloning) the Chatter Feeds (Items and Comments) from ObjectA to ObjectB. I alway run into Heap size limits when ...
1
vote
2answers
26 views

Error handling for page that queries more 50,000 rows

I have a VF page that allows a user to perform dynamic searching in filter on an object. The user can easily specify a query that will result in more than 50,000 records. I would like to catch ...
1
vote
1answer
57 views

Apex heap size sudden increase

I've been noticing that, in some cases, the heap size I obtain by calling Limits.getHeapSize() and the actual amount used by the transaction differs by a big margin. The problem is, I have to call a ...
19
votes
1answer
266 views

How many SOQL queries are spent for subqueries?

Apex Governor Limits docs state that: In a SOQL query with parent-child relationship subqueries, each parent-child relationship counts as an extra query. However, when a query with a single ...
2
votes
1answer
36 views

Do SOQL queries of Tooling API objects count against governor limits?

The "system catalog" objects of the Tooling API (EntityDefinition, FieldDefinition, etc) provide a lightweight alternative to describe() calls, for example: // get a list of fields for an sObject ...
1
vote
1answer
96 views

In Apex limits, custom metadata records can have unlimited SOQL queries. Advantages?

Is there any way to overcome the apex limit for total number of SOQL queries issued using custom metadata records?
1
vote
1answer
48 views

How to find current storage limit usage in Salesforce (in tests)?

We have Limits class and lot of methods showing current usage of DML statements, SOQL queries etc, but there is no method which shows total amount of storage capacity for records and no method which ...
-1
votes
1answer
82 views

Test.startTest() not working as desired [closed]

I came across a very weird issue. In my test method, I'm running into a too many soql queries exception before even setting up my test data for a use case. So, I've moved Test.startTest() little bit ...
0
votes
3answers
61 views

We are receiving an error message that exceeded my single email limit and how to overcome this

I've a requirement to send single email messages to external users and I wrote apex class to achieve this.We send upto 80 mails per day,eventhough I'm getting email limit exceeded error.Please help me ...
1
vote
3answers
55 views

Deleting records from custom object based on Standard object

Need help in identifying the records that needs to be deleted in a custom object: Opportunity_LGT Background: Opportunity_LGT is a custom object that was created to store few fields of Opportunity ...
2
votes
3answers
75 views

Dynamically get a namespace prefix

In an app that I'm creating, there are some places where I need to create objects based on their string name, and need to take the apps namespace prefix into account dynamically. I've created this ...
0
votes
2answers
77 views

Too Many Rows 50001

Internal user send email to create case in SFDC, but after case creation, when user try to reply (custom VF page) it throws System.LimitException: Too many query roews: 50001 error. As per log ...
2
votes
2answers
35 views

How to determine the Remaining Email in apex

Integer email_left = Limits.getEmailInvocations(); system.Debug('Used Email: '+email_left); Integer emailLimit = Limits.getLimitEmailInvocations(); system.Debug('Email Limit: '+emailLimit); I got ...
2
votes
1answer
60 views

Create Map to avoid Query in For Loop

How can I create a Map for such situation - to write my Query outside of For loop and avoid getting caught into "Too many SOQL error :101 " for(ChildRelationship child : childRecords) { //Loop ...
0
votes
1answer
36 views

Trigger Governor limits concern [closed]

I have a concern for below triggers, should we hit governor limits for more than 200 records updated at one go? Trigger 1: trigger BatchTrigger on Compliance_Incident_abv__c (after update) { ...
1
vote
1answer
42 views

Governor Limits Across Object Triggers

I am architecting a solution and wanted to know whether information exists regarding the depth of governor limits, when a trigger invokes another trigger (different objects). For example, I have 2 ...
1
vote
0answers
28 views

API call counts if use Salesforce Workbench Developerforce

I recently had issue with my org with exceeded request limit and I usually used developer console a lot but if I use workbench.developerforce will that still be count as API calls and account to my ...
0
votes
0answers
45 views

REQUEST_LIMIT_EXCEEDED from Salesforce.com API

All my code is bulkified and I'm not sure what is causing that to get me the limit exceeded, is there a way to find out what page or trigger causing? if I use Database.query approach will that not ...
0
votes
1answer
107 views

Synchronous Limit and asynchronous Limit in apex

can anybody tell me that what is difference between Synchronous Limit and asynchronous Limit in soql governor limit in apex?
2
votes
1answer
31 views

Incremental SOQL vs SOAP API calls

I am retrieving records that have been updated/deleted after every backup, i.e. Incremental backup procedure. There are different options to pursue with this: Bulk - Cannot support all the objects ...
1
vote
1answer
149 views

Select Count() with dynamic SOQL - how to stay in Governor Limits?

I am trying to fix my code so I don't hit any governor limits on my SOQL queries. Long story short: I am just learning on how to use maps, but I'm trying to figure out how I can do a SelectCount ...
1
vote
1answer
78 views

How to avoid writing Select statement within for loop

How to write a select statement in For loop I have a requirement as below we need a trigger to insert record into Location object everythime an Account record is added/update but it has to check if ...
1
vote
2answers
103 views

soql limit exception

I am getting a SOQL System.LimitException. I know there is a query within a for loop. But it's my work, it needs to be there. What i wanted to do is handle this exception in apex controller like ...
4
votes
1answer
167 views

Number of callouts allowed from batch execute method showing zero?

I have the below sample code: global class BatchApexExample implements Database.Batchable<SObject>{ public Database.QueryLocator start(Database.BatchableContext bc){ ...
2
votes
1answer
141 views

How to Reproduce the Concurrent Requests Limit?

I'm trying to write code that will reproduce the Concurrent Requests limit (10 requests longer than 5 seconds, described here: ...