The Limits You Do not Know in Salesforce

While the number of API calls and storage limits get all the attention when planning a large-scale Salesforce implementation, less well-known limitations can completely derail your project. With a CTA as your guide, examine the solution design and the performance impacts that only became apparent after rollout. Dive into the details of possible workarounds and the limitations encountered during each attempted corrective action. Let’s see the The Limits You Don’t Know Can Hurt Your Project.

See if you can guess the limits that caused the pain (hint: it involves Email Messages and Files) and help architect a resolution. This session is for aspiring architects and developers who face enterprise-scale challenges. This session will help you in Identify design decisions that avoid governor limits when working with large data volumes and files.

YouTube video

Our Scenario – Transportation Company (TC)

The global company wants to modernize its support organization. We are focused on business accounts and 10k service users across AMER, EMEA, and APAC—extensive experience with custom development, new to Salesforce.

Business Requirements

  • Current processes managed through which customers prefer
  • Lack of comprehensive customer view for hand-offs across the world
  • Need to adhere to local regulations and requirements
  • Recent security breaches in existing systems need to move to another solution. quickly

What project methodology do you recommend? Agile

  1. Delivering quickly to retire systems is key
  2. You’ll focus on minimum viable project functionality for initial groups
  3. You will align to standard, out-of-the-box functionality
  4. Your project has passed its first hurdle

Limit Calculation

  • As an experienced architect, you start by estimating limits
  • 2 million Accounts
  • 4 million Contacts
  • 50k cases/month for initial groups
  • 5 shipments per customer per year
  • Integration to logistics systems that support REST

B. What should we calculate? 1. Data & File Storage 2.API Consumption

Data & File Storage

  • Accounts & Contacts = (2 M + 4 M) * 2 KB = 12 GB
  • Cases = 50 K * 36  = 1.8 M * 2 KB = 4 GB
  • Email Assumption = 1.8 M * 3 per case * 2 KB = 11 GB
  • Shipments = 2 M * 5 * 3 * 2 KB = 60 GB
  • Total 87 GB over 3 years
  • Initial Group
    • 10 GB + (1,000 * 20 MB) = 30 GB
    • 10 GB + (1,000 * 2 GB) = 2 TB file
  • Full org
    • 10 GB + (10,000 * 20 MB) = 210 GB
    • 10 GB + (10,000 * 2 GB) = 20 TB file
  • File Assumptions
    • 100 KB/file = 200 M
    • 200 KB/File = 100 M
  • Go to API Calculation

API Calculation

  • Cases per day
    • 50 K per month / 20 work days = 2.5 K per day
    • 10 calls to logistics for related information
    • 2.5 K * 10 = 25 K calls
  • Shipments,
    • 4 calls per shipment
    • 2 M * 5 /365 = 28 k * 4 = 112 K calls
  • Total 140 K per day
  • Initial Group
    • 1,000 * 1,000 = 1M / 24 Hours
  • Full org
    • 10,000 * 1,000 = 10M / 24 Hours
  • If needed, Go to Data & File Storage

Email Functionality

  • Given the importance of email, let’s dive deeper into solving this requirement
  • Customers need to email CT with issues, questions or requests
  • CT Support will process the case and follow up
  • Internal CT employees may forward items for support 

How should email functionality be delivered? 1.Custom Email Handler 2.Email to Case

Custom Email Handler

The custom email handler works fine during development, problems start at go live. Timeouts and locking frequently occur. CT is new to Salesforce with little knowledge of LDV and bulkification. The backlog of cases grows & customers are not supported.

Email to Case

  • CT repurposes its existing email address to create cases in Salesforce. automatically
  • Support agents can quickly reply from within Salesforce and leverage templates.
  • The MVP is quickly delivered with other standard functionality, such as the service console.
  • Support teams are happy with the new functionality
  • The unsecured systems were retired on schedule.
  • Plans are made to expand to the entire support organization quickly.
  • Your project is a success!
  • On-demand email to case supports 1,000 per user license, up to 1M
  • No limit on outbound email sent from the Case to a Contact
  • Keep looking, but make it fast.

Learn about Email-to-Case in Salesforce.

Data/File Storage or API

  • Overall storage is only 60% used
    • Email Message is the top object
    • Case is next
  • File storage is only 35% used
    • Content Bodies reports 30 M objects
  • API limits
    • Ranges between 10-15% used per 24 hours
  • Let’s take a look at Salesforce CRM Content Limits.
  • Content: maximum number of files
    • 30 Million
  • You take a quick look at data storage and Content Bodies are 30,000,017

Configure/Build An Archive Solution

  • No native options in Salesforce to archive
  • Customer 360 Privacy Center
    • Didn’t exist at the time
    • Aimed at data retention tied with privacy regulation
  • Build your own solution – big objects, big questions?
    • How handle schema changes
    • How handle binary content/view
    • How do you restore
  • None of these options get you going at 88 mph to quickly get out of the situation

Content Object Model

How should you query the related files? 1.Content Document/Version 2.Hmm, something is missing.

Content Document

  • Content Document holds the header information about a File
  • Content Version has the binary information, as well as multiple revisions (if needed)
  • Neither of these relate back to the Case or Email Message
  • See if you can find the missing link
  • Link between file in Salesforce and where it is shared
  • ContentDocumentId
    • LinkedEntityId
    • ShareType
    • Visiblity
  • So let’s look at the object
    • Hmm, there’s an error with a basic SELECT

Try below query

SELECT Id, LinkedEntityId, ContentDocumentId, ShareType, Visibility FROM ContentDocumentLink 

Then you will get below error

Implementation Restriction: ContentDocumentLink requires a filter by a single Id on ContentDocumentId or LinkedEntityId using the equals operator or multiple Id’s using the In operator.


Check out our YouTube, and don’t forget to subscribe to our channel, so you’re notified immediately when a new video is available.

Amit Chaudhary
Amit Chaudhary

Amit Chaudhary is Salesforce Application & System Architect and working on Salesforce Platform since 2010. He is Salesforce MVP since 2017 and have 17 Salesforce Certificates.

He is a active blogger and founder of Apex Hours.

Articles: 466

One comment

  1. Thanks for your post.
    Share large files up to 30GB for Free
    Reliable Resumable Upload: Login, start your upload today & resume it tomorrow

Leave a Reply

Your email address will not be published. Required fields are marked *