Salesforce governing limits — A tester’s guide

Melissa Fisher
3 min readAug 4, 2022

One of the challenges that I face is that talk of salesforce governing limits is very geared to developers and has a lot of technical jargon in it. What I’ve been trying to do is break it down into plain English and demystify this topic. It is generally a work in progress and I’m open to Feedback.

Reach a limit — code breaks and won’t work

If you reach a salesforce governor limit, then in short, your code breaks and it won’t work. This is going to impact our customers as things will stop working. So this is very important to understand.

Explain the salesforce governor limits

Salesforce governor limits are there to ensure multiple users can access the platform at the same time without slowing down resources.

There is an example I came across where you can think of it like a building where you are renting an apartment. You are sharing things like water, gas and wi-fi.

Imagine if everyone in each department tried to download a huge file all at the same time. You might see a slow down in this.

So in terms of salesforce, we’re not sharing gas, water and wi-fi — organisations are sharing the database, APIs and application servers.

What I’ve tried to do is see common themes. The reason is, as a tester, I want to know what triggers that conversation to discuss salesforce limits. If I don’t know what triggers it, then the conversation about salesforce limits might not happen.

So this is what I’ve come up with (so far) —

Data.

Jobs.

Emails.

Time.

Application.

Salesforce API.

Data

The salesforce database — Traditionally data is stored in database tables, however, in salesforce, data is stored in objects.

Retrieving data — SOQL

There are things called SOQL Limits. This is a Salesforce Object Query Language (SOQL) that queries the salesforce database. All this does is take the information from the database. It does not change the data in any way.

A question you can ask is simply, Are we retrieving information from the salesforce database that may reach a limit?

Retrieving data — SOSL

There are SOSL salesforce limits. This is a Salesforce Object Search Language (SOSL), which is used to do text-based search queries against the search index.

Manipulating data — DML

There are DML salesforce governing limits. This is a Data Manipulation Language (DML) that changes the data in the database. These basically do is insert, merge, delete and restore data in Salesforce.

  • A question you can ask, What data are we using here and are we doing anything with it (inserting, deleting etc)?

Custom actions before or after changes to data — Triggers

  • Apex triggers — these allow you to perform custom actions before or after changes to Salesforce records e.g. a trigger runs before an object’s records are inserted into the database
  • A question you can ask, Are we doing anything with the data before or after changes to Salesforce records?

Displaying large amount of data

If we are trying to display a large amount of data in the application, then we might hit salesforce limits. Particular limits are such as getQueryLocator and Lightning query cursors.

A question you can ask is, Are we trying to display large amounts of data to the user, which may reach a limit?

Jobs

These are tasks in the background where something is processing (a user doesn’t see this). In the salesforce world this is called an apex job.

Are there jobs we are running, which may hit a salesforce limit?

Are we running jobs in batches?

Emails

Salesforce has limits on emails. We need to think about the type of email it is and how many times it is likely to be sent. More information can be found here. https://help.salesforce.com/s/articleView?id=000334302&type=1

Time

We need to think about how long things take to process. If something is taking a long time then it might max out the CPU time on salesforce servers, and hence taking the shared resources away.

Application

How are we displaying information to our users? If we are trying to display a large amount of information, then we might hit salesforce limits — there are limits related to getQueryLocator and lightning query cursors.

Salesforce API

There are limits to the Salesforce API such as the Connect API method. If we’re using the Salesforce API, then we should ask questions around the salesforce governing limits.

Help

Turn this option on to Enable apex warning emails https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits_emails.htm

Feedback

If you’re a tester that tests salesforce applications I would enjoy hearing from you. Is this document making sense on salesforce governing limits? What would you add or change to this document?

--

--

Melissa Fisher

Thinking outside the box and disrupting people's thinking.