Hot answers tagged

20 votes
Accepted

Percent of Apex Used: Do spaces count?

A quick test would suggest that they do... Here is a simple class in my DE and the code usage If I add loads of characters, the usage goes up.. when I removed them, it went back down, now I added ...
user avatar
20 votes
Accepted

Is Salesforce API limit on outbound or inbound?

Unfortunately your test is flawed. What you're missing here is that using the Developer Console uses API calls to the Tooling API (it's a little crazy that these are counted, I know)! The API call ...
user avatar
  • 13.3k
19 votes
Accepted

About the 10 custom objects limitation for community licenses

There are no technical restraints regarding the ten object limit. This is actually mentioned in the documentation somewhere. However, if salesforce.com finds out (however that may be), you would be in ...
user avatar
  • 438k
18 votes
Accepted

First error: Cannot have more than 10 chunks in a single operation. Please rearrange the data to reduce chunking

Because you wait until the execute() method to query for the records to delete, you are not utilizing the scope parameter (the second parameter of the Database.executeBatch method--in your case, 200) ...
user avatar
16 votes
Accepted

What is the longest URI that Salesforce will accept through the REST API?

+edit 2020-10-25: Looks like there's some concrete documentation as of API v49.0 (Summer '20). The documented limit is 16,384 bytes. The recommendation is to limit the URI to 2000 bytes, and headers ...
user avatar
  • 49.4k
13 votes
Accepted

System.LimitException: Too many queueable jobs added to the queue

As you are chaining the jobs you have limit of 1 on child jobs. When chaining jobs, you can add only one job from an executing job with System.enqueueJob, which means that only one child job can exist ...
user avatar
13 votes

How can I check that parent has more than 1 child?

You can use a HAVING clause: AggregateResult[] results = [SELECT COUNT(Id) sum, Tool__c Id FROM Gear__c WHERE Tool__c = :tools GROUP BY Tool__c HAVING COUNT(Id) > 1]; This will give you a list of ...
user avatar
  • 438k
13 votes
Accepted

Infinite queueable chaining, what is the drawback?

The primary limitation you will face is throttling. Once you surpass a chain depth of 4, Salesforce will slow you down to 15 seconds between executions. If you need to process a high volume of jobs, ...
user avatar
  • 143k
12 votes
Accepted

96% code already used. How to manage it?

You'll need to clean up your code. The 3,000,000 character limit is the universal limit for any namespace. I've found that the typical code base can be optimized by at least 50%. Try this: Delete ...
user avatar
  • 438k
12 votes
Accepted

How is stack depth calculated?

When you say 997, it runs 998 times counting initial call (actually not hidden) The call to the class constructor Execute anonymous This can be tested in Dev console > open log > Debug > ...
user avatar
11 votes
Accepted

Concurrent API Request Limits per org or per user

If more requests are made while the 10 long-running requests are still running, they’re denied. Salesforce allows you to have a limit of 10 long running requests per ORG, where long running requests ...
user avatar
  • 717
10 votes
Accepted

Limit Exceeded: Too many target object ids

See the documentation. You can list up to 250 IDs per email. If you specify a value for the targetObjectIds field, optionally specify a whatId as well to set the email context to a user, contact, ...
user avatar
  • 438k
9 votes
Accepted

Can I only update 200 records at once with SOAP API? Enterprise WSDL Limitation

Updating the database using SOAP API You can only send 200 records at once to the DML operations create update upsert delete This is in the documentation under Reference > Core Calls for each of ...
user avatar
  • 3,548
9 votes

Large size file upload related to custom object

Yes you can do this using chatter. Check here Upload a File as Large as 2GB in Salesforce Using a Visualforce Page Basically what you need to do here is include chatter component in the VF page and ...
user avatar
9 votes
Accepted

System.LimitException: Too many SOQL queries: 101

Hi You are getting the error because you are using Messaging.renderStoredEmailTemplate() in for loop as this is counted towards the SOQL governor limit as one query. To avoid the exception you have to ...
user avatar
9 votes

System.LimitException: Too many SOQL queries: 101

Rishi Golyan correctly identified the issue, however, Messaging.renderStoredEmailTemplate() works on single ids rather than a list of ids. So, simply moving that method call to be outside of your ...
user avatar
  • 49.4k
9 votes
Accepted

How can I check that parent has more than 1 child?

You're pretty close to a solution with your parent-child subquery. The big thing to realize is that, similar to how adding parent__r.someField__c gives you a real SObject instance nested in your ...
user avatar
  • 49.4k
8 votes
Accepted

String length exceeds maximum: 6000000

Unfortunately you're SOL when it comes to that sort of limit, your only route is going to be moving the operation off Salesforce. One option would be to create a Heroku app with a single endpoint that ...
user avatar
8 votes
Accepted

List of Features and Limits which can be activated/increased by the support

Limits Per day limits can be increased temporarily to accommodate unusual business conditions, such as a spam attack, marketing campaigns, etc. All such increased limits can only be increased a ...
8 votes

Multiselect Picklists with many values

Currently there will be no solution without tradeoffs. In most cases I tend to pick approaches which provides good UX and best convenience for the users. To get something user friendly multiselect ...
user avatar
  • 33.7k
8 votes
Accepted

Is it possible to check how close we are to our API call limit before making a call through the API?

There is a header returned for both the SOAP API and REST API. See the documentation for details. Responses appear as: REST (header) Sforce-Limit-Info: api-usage=18/5000 SOAP (SOAP header in XML ...
user avatar
  • 438k
8 votes
Accepted

What does Limits.getAggregateQueries() represent?

Possibly the naming AggregateQueries is very misleading. My first thought was it should be related to a GROUP BY clause - but it seems to be different. I did not try it on my own but found this ...
user avatar
  • 33.7k
8 votes

Concurrent API Request Limits per org or per user

Concurrent Apex and Concurrent API limits are different. Concurrent API limit : for production and sandbox it is 25 for 20 or more than 20 seconds, for example : (describe in 3 scenarios) If you are ...
user avatar
8 votes
Accepted

Aura transaction details

See this answer where I experimented with the limits and came across some rather interesting answers: Question 1: will we hit 101 SOQL query limit in this case? Yes. For now, governor limits are ...
user avatar
  • 438k
8 votes

How to monitor Platform Events consumption?

Update from the Winter '20 release notes: Monitor Platform Event Publishing Usage in REST API The hourly event publishing usage for standard-volume and high-volume platform events is now ...
user avatar
8 votes
Accepted

Do SFDX commands count toward limits?

Yes, SFDX commands do consume and count towards the limits of the resources they utilize on your target orgs, including API calls, Bulk API jobs, streaming and platform event consumption, and others. ...
user avatar
  • 87.3k
8 votes

How to use Limits.getCallouts() in a test class for a callout in a future method

Typically, if I want to verify the callout is made and there may be asynchronous processing involve, I just track it on my mock. class MyMock implements HttpCalloutMock { Integer calls = 0; ...
user avatar
  • 143k
7 votes
Accepted

Error - "Time limit exceeded - Your request exceeded the time limit for processing"

I have encountered with this issue. Actually when you are going to hit the CPU limit through Visualforce page it won't show Maximum CPU Time: 10000 out of 10000 It only shows last method execution ...
user avatar
  • 22.3k
7 votes
Accepted

Custom Field Limits For Managed Packages

Custom fields created post-installation, those that do not have a namespace, are counted normally towards that object's limit. As an example, let's say you have managed fields on a standard object A ...
user avatar
  • 438k
7 votes
Accepted

Apex Email Limits Clarification

Edit: Having been questioned about the behavior, I just tested this and found that you can send as many emails as you can handle within governor limits. As a proof of concept, I wrote the following ...
user avatar
  • 438k

Only top scored, non community-wiki answers of a minimum length are eligible