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)

0
votes
1answer
32 views

Create test data with more than 10000 rows dynamically in apex

I am trying to Create test data with more than 10000 rows dynamically in a test class. Am hitting the dml row limit error (Too Many DML Rows: 10001). I dont want to use loaddata feature as I need to ...
0
votes
1answer
13 views

“Unsubscribe” from messages about limits

If I reach limits for my Salesforce edition I'm receiving message like "Hourly limit exceeded for processing workflow time trigger". Is there any way I can stop receiving these messages, like ...
1
vote
1answer
22 views

Salesforce Visual Flow reaching Governor Limits

I'm trying to run a Visual Flow in Salesforce that runs through all of a custom objects records called Cross Sells (~1,000,000 records) and updates a lookup field. This flow is failing due to the ...
2
votes
2answers
24 views

Trigger Help: Update Custom Email Field based on Value in Lookup Field (Lookup to User) Using Trigger

I am new to Apex and would like to practice updating a custom email field which derives its value based on a custom lookup field. I understand this can be done with a simple formula, but want to ...
3
votes
1answer
32 views

Governor limit on trigger clarification

If I have a below loop: List<id> var2=new List<id>(); for(Sobject1 s:trigger.new){ var2.add(s.Sobject2); for(Sobject2 var: [select Sobject2 from Sobject where Id IN:var2){ //do something ...
1
vote
0answers
29 views

ConcurrentPerOrgApex Limit exceeded

We are calling Queueable Interface from trigger to make multiple callouts to external systems. The number of callout from Queueable class is 50 as the other system can process only one record at a ...
0
votes
1answer
22 views

Number Of SOQL Queries 100 After Single Query In New Unit Test Method

In the below unit test my debug line System.debug('+++ Number of Queries used in this apex code 2.1 so far: ' + Limits.getQueries()); shows that the number of queries after my single query, in a new ...
0
votes
1answer
54 views

Query Activities on Lead

i need to query activities on lead. the idea is i want to get which lead has 10 activities with "unreach" subject and automatically change it to unqualified. i will use scheduled apex to daily check ...
1
vote
0answers
20 views

How can I find out what my concurrent requests are?

Is there a way to report/query on what my concurrent/long running requests are? Looking at this link I would like to be review my org and see if there are any processes getting close to, if not ...
2
votes
2answers
105 views

System.LimitException: Too many DML statements: 151

To complete this challenge, you need to add a trigger for Opportunity. The trigger will add a task to any opportunity inserted or updated with the stage of 'Closed Won'. The task's subject must be ...
1
vote
1answer
37 views

Design practises against 50,000 row limit

please see my scenario. I have 2 custom objects A(child) and B(parent>. Date model is such that Account is the master detail parent of A, while B is the lookup parent of A. The objects Account and B ...
0
votes
1answer
37 views

Solution to optimize code that exceeds limits of 50k rows returned

I would need guidance over how to avoid getting de 50k limit rows on one visualforce page that monitors the transactions that are going to be made on the present day + 2 next days, shows a lot of ...
6
votes
2answers
349 views

Exception: QUERY_TIMEOUT Your query request was running for too long

Querying on approx 25 million contacts using the following query in database.getQueryLocator. Used Query Resource Feedback (Link) to get some feedback about query and here are the results. Query - 1: ...
1
vote
0answers
49 views

System.LimitException: Too many SOQL queries: 101 in class and trigger

When I run the test class I get an error as follows: System.LimitException: Too many SOQL queries: 101 Stack Trace: Class.UpdateUserHandler.updateUserOnAccount: line 41, column 1 ...
6
votes
2answers
148 views

DML Limits are reset when?

I have a scenario where I need to update 500,000 Accounts in production to change their Record Type, but I want to avoid writing a Batch class for one-time use. In addition, using DataLoader would ...
3
votes
2answers
90 views

Large size file upload related to custom object

Is it possible to upload the files with size more than 25MB and can we show them in related list of a custom object? what is the best way to achieve this? Do we need to use external storage if the ...
5
votes
6answers
249 views

Is it a good practice to skip queries with empty conditions?

I am wondering if it's a good practice to skip queries when there's nothing in 'where' clause, especially in triggers. Like: if (idList.size() > 0) res = [select id from Case where id in ...
3
votes
1answer
137 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
38 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
57 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
45 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
87 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
40 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
41 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
28 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
37 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
51 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
92 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
89 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
34 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
47 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
46 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
259 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
56 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
33 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
132 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
109 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
213 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
285 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: ...
8
votes
2answers
140 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
94 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
51 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
53 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
29 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
67 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 ...
23
votes
1answer
396 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
45 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
133 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
86 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
89 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 ...