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)

2
votes
1answer
80 views

Too many callouts 11 while testing using webservicemock interface

i have written a test class for a controller in which one of the method makes a callout. This is one single invocation of external SAP webservice. But my debug log shows more than 10 invocation of the ...
0
votes
0answers
11 views

Get Chatter Topic Limits via Apex

I know that the current governor limit allows only 10 topics in single chatter post thread. Is it possible to get this limit using apex, via the Limits class for example? This would allow the code ...
5
votes
1answer
86 views

Apex CPU time limit exceeded

I just got this error when trying to deploy new components to Prod. It's happening on Apex test classes that already exist in Prod, not new ones in my change set. I understand that this error relates ...
4
votes
1answer
22 views

Sites governor limit on unauthenticated users?

Are there any limits around how many simultaneous unauthenticated/anonymous/guest users can view a site at a given time? I could've sworn that there was a limit that meant there could only be 10 ...
1
vote
2answers
46 views

Sending a SOAP web-service for each Lead insert

I have a requirement where I have to send out a web service to a third party system every time a Lead is inserted. I can do it by calling the web service via trigger. However I want to make sure that ...
4
votes
2answers
95 views

Email relaying and email limits

According to the documentation there is a limit of 1000 emails per day if sent from APEX or API. If I had configured an email relay, would sending out an email from APEX count towards the email limit ...
1
vote
1answer
34 views

How to check API call requests from perticular user in salesforce on daily basis?

Is there any way in salesforce we can measure/check how many API calls specific user consumed/made? we need this to identify if any integration user is eating up most of the API calls and is there ...
1
vote
1answer
22 views

Managed packages governor limits

Is salesforce more lenient towards managed packages? I mean do they let the code in managed packages get better governor limits? Also, What should I choose? Managed packaging or Unmanaged packaging?
0
votes
1answer
19 views

First deployement questions

I am ready to deploy my first project, I have a couple of random questions before that 1) I have a form and I am performing insert operation after all the fields are entered and submitted. Here I ...
3
votes
1answer
46 views

Messy Change Log Levels Window

I'm trying to change the log levels in the Developer Console to display the transaction Limits , but I noticed that the window now displays +30 Settings, so I have no idea which one I should update. I ...
0
votes
0answers
23 views

Can we post into multiple linkedin groups at one instance using group API of linkedin

I am trying to post into multiple groups of linkedin using linkedinAPI http://api.linkedin.com/v1/groups/{group-id}/posts This works fine with a single group. I cant find any documentation on ...
2
votes
1answer
87 views

Does the “Total number of records retrieved by SOQL queries” governor limit apply to sub-selects?

I have a requirement to change the status of any Contact (master object) that has had a Booking (detail object) but not in the last 2 years to "Inactive": Date d = Date.today().addYears(-2); ...
2
votes
1answer
49 views

Find out if field is of type Currency without consuming Describe's?

Parts of my code copy hundreds of arbitrary fields of an arbitrary object to another object. Before copying currency fields I want to do some fx conversion. How can I find out if a field is a ...
3
votes
1answer
91 views

Is it possible to combine result-sets in REST API query?

I'm creating a sync engine for a mobile app, and I want to get meta data about the state of a whole lot of different objects in as few API calls as possible. Is it possible to pass more than one SOQL ...
9
votes
1answer
407 views

What happens if the Percent of Apex Used reached 100%?

I have an org which has Percent of Apex Used: 89.64% Just curious to know what happens if we reach 100% of apex code. Does the salesforce allow the to write code more than that?
5
votes
0answers
173 views

String length exceeds maximum: 6000000

Are there any work arounds for this issue? I'm trying to upload a file(attachment) to an external service. It works fine until my file sizes get about ~5 mb. Then I start getting the following ...
4
votes
1answer
228 views

System.LimitException: Apex heap size too large Salesforce

Map sObjectsToClone = Map of child object along with there relationship name. I have to clone each relationship to each opportunity. global List<sObject> start(Database.BatchableContext BC) ...
3
votes
2answers
31 views

Work out remaining singlemailmessage capacity in test

I have an Apex class that does some complicated decisions surrounding whether to send an e-mail to a user or not, including the fundamental "can we send any more e-mails today" check from Salesforce: ...
2
votes
1answer
342 views

System.LimitException: Too many query rows: 50001

What I am trying to do is to set a date in my date field and also update the object. I am using the class below to do so which works just fine in my sanbox but in production I am getting this error: ...
1
vote
1answer
79 views

Getting Child and Grand Children records Query

I would like to get all the records related to a parent which includes the children, grandchildren, great grandchildren etc. What is the best way of writing such a query? The end goal is, I am trying ...
4
votes
1answer
160 views

SOQL for loop and governor limits

With regard to the governor limit of 100 SOQL calls per transaction, does the below SOQL for loop consume one call per chunk or one call across all chunks combined? Map<String, ID> campaignMap ...
3
votes
1answer
56 views

What is Limits.getInteractionQueries() used for?

Browsing the Limits class recently, I saw there was a getInteractionQueries() and getLimitInteractionQueries() method. Can anyone tell me what this Limit refers to? Running the ...
7
votes
1answer
70 views

Governor limits on http callouts

I am having to make a httpcallout from a VF page to get some data from an external source. I can see there is a limit of 10 callouts per transaction Total number of callouts (HTTP requests or ...
2
votes
2answers
64 views

Test if a field is available on arbitrary SObject record without using Describe calls

I have many Custom Objects in my package that have a common custom field Version__c. One part of my app serializes and deserializes records to/from Json. While deserializing I want to change this ...
5
votes
1answer
292 views

Apex Batch job limits not clear Queued vs Scheduled

We have a discussion going on, to know now exactly what the limits are on batch apex jobs. The docs are really not clear on this. In this document it states that "Up to five queued or active batch ...
1
vote
3answers
53 views

Governors Limits for reports

I am developing some kind of customized report functions using APEX and VF. As the conditions are quite complex and I need to query different objects even to get a number for one column for my report. ...
5
votes
3answers
450 views

How separation of Test Class can solve 101 SOQL Queries Limit Exceeded Error?

Recently one of my colleagues was trying to deploy to production some opportunity trigger activation, but during validation deployment two of ten test methods from TestMyMysteriousApexClass failed ...
8
votes
2answers
458 views

Why am I *not* hitting a governor limit?

I have an account that has 626,482 opportunities spread over 1,368 owners. In the Developer Console if I run the following Apex List<SObject> recs = [select sum(amount), ownerid from ...
4
votes
2answers
199 views

How does salesforce calculate DML rows? What is included to DML Rows Count?

Does anyone know how does salesforce calculate DML rows? What is included to DML Rows Count? Consider following code which hits "System.LimitException: Too many DML rows: 10001" ...
6
votes
1answer
374 views

Debug logs still measuring code statements and not CPU time

You'll have to forgive me if I failed to RTFM as to why I'm seeing this, but I was under the assumption as of Winter '14 that Apex execution contexts are no longer measured in code statements, but in ...
4
votes
1answer
524 views

Too many SOQL queries

This question has been asked before, but none of the answers on those threads have helped so far. Getting the following error when trying to deploy a test class from the sandbox to production in the ...
25
votes
3answers
221 views

Any reason to skip DML on empty lists?

In parts of my code I have DML statements with an if around to only do the DML if the list is not empty: if( !recordsToUpdate.isEmpty() ) { update recordsToUpdate; } Couldn't I just write? ...
3
votes
1answer
89 views

Transaction governor Limit reset

I have a simple Apex Class, method execute() which reads every 5000 (Queries everytime for next 5000 leads) leads and applies business rules and update 200 at a time. but we have triggers on the Lead ...
6
votes
1answer
173 views

Querying Large volumes of data in Apex

I am looking for a solution where i have a scenario to query large volume data and do an update on them. Is there a way i can do, query once and then querymore on that object instead of getting all ...
4
votes
1answer
143 views

Avoiding SOQL limits in a recursive method

I have a SOQL query in a recursive FOR loop. It didn't give me SOQL limit issues on my test data, but apparently we have a managed package whose Apex is hitting the limit due to this code. public ...
4
votes
1answer
84 views

Separate Execution context for Visualforce Page?

So i have a Visualforce Page which have 5 VF components(See Example below). <apex:page controller="InsightController" sidebar="false"> <c:component1 /> <c:component2 /> ...
38
votes
3answers
2k views

How does SF calculate the CPU time?

How does SalesForce calculate the CPU Time that was introduced in Winter '14? I am seeing varying results from it. Why does the CPU count vary? I am running a single block of code over and over again ...
13
votes
5answers
805 views

Scheduled job governor limit workaround

I am looking for a solution where I can schedule more than 5 jobs (Running/Queued) at a time. but there is a governor limit that, we can have only up to 5 jobs that can be in Running/Queued status at ...
4
votes
2answers
844 views

System.LimitException: Too many describes: 101.?

I am getting this error as i have used getdescribe under for loop.Can some tell me how should i solve this..how to create map for this .please help. Thanks Map<String, ...
3
votes
1answer
139 views

Should we use Work flows for field updates?

Is this recommended to use work flows for field update? I read that if we use work flows for field updates then triggers are get called twice. First before calling work flows(As per Order of ...
4
votes
1answer
900 views

Understanding Rest Apex and Webservice Limit

I'm implementing a webservice exposing an Apex Class. I was reading understanding execution governors and limits and I dont see clear enough the limit for my @RestResource. I only found some ...
4
votes
1answer
266 views

Any good workarounds to QUERY_TOO_COMPLICATED error for dynamic SOQL?

When running a dynamic query with certain formula fields I get the following error: System.UnexpectedException: Query is either selecting too many fields or the filter conditions are too complicated. ...
1
vote
1answer
734 views

Workarounds to avoid Error: “Too many SOQL queries: 101”

I am hitting salesforce limits in 3 cases: When user is adding a document from a large list of docs which is greater than 100? (Eg error when they are trying to pull a document from their library ...
0
votes
1answer
107 views

Governor Limit Examples

I'm going to write a daily scheduled apex class. I have a couple of questions about the governor limit: 1)Example: > Account acct = new Account(name='test account'); > > insert ...
1
vote
2answers
498 views

Is is safer (limitwise) to call Database.getQueryLocator() with SOQL String than Static SOQL?

In my Apex Batch start() method I am returning a Query Locator to get the full 50 million records and not be limited to 50k. Is there a difference between calling ...Database.getQueryLocator('SELECT ...
0
votes
1answer
246 views

Maximum size of Map<Id,Id> in Batch start() before reaching limits

To do some de-duplication (1: no SELECT DISTINCT in SOQL, 2: GROUP BY restricts me to 50 K records) I rely on a Map in my Batch start() method. How many entries can this map have before I reach the ...
1
vote
1answer
1k views

Access Field on Lookup Relationship in trigger

I have a Lookup relationship to another custom sObject, and I want to access: sObject.sObject1__r.Name However, sObject__r.Name is undefined in the context of the trigger. If I attempt to run this ...
1
vote
1answer
593 views

Best way to do a count() from a custom object having more than 1 million records

I have a custom report which i need to build on visual force page which is displayed on a force.com site. I have to display count() of records on a custom object which has more than 500k records. I am ...
2
votes
1answer
346 views

Best Practice with Triggers - To combine or not to combine

Just a simple question on best practices - Is it better to combine simple triggers or leave them separate. For example, I've got a trigger that updates a field based off of another field, and then a ...
3
votes
2answers
369 views

Too many query rows: 1000001 - Is this a new undocumented limit?

A page that yesterday generated a timeout today showed this new error Too many query rows: 1000001 Error is in expression '{!myMethod}' in page myPage I know this error with ten thousand ...