A Tale of Governor Limits and Solutions in Salesforce

Thrilling story of Salesforce Technical Architect on a quest to solve application problems and avoid governor limit errors

This is a work of fiction. Names, characters, businesses, places, events and incidents are either the products of the author’s imagination or used in a fictitious manner. Any resemblance to actual persons, living or dead, or actual events is purely coincidental.

Ha ha ha joking.. its combination of many real stories of my previous projects and few readers might be from my team itself 😉 . Leave comment my brave team mates if you are able to co-relate !!!

I tried to summaries as much as possibilities about governor limit errors and way to get out of it. Most of scenario described below may not be the first choice of Technical Architects however because of many reasons like budget, resource skill, tools available and compliance, bad decision could be taken which causes ripple effect on Salesforce scalibility.

Before start, I would encourage readers to leave comment on post and let everyone know in this suspenseful story, did you catch governor limits and Solution already before its exposed ? In this blog post, answers are mostly in invisible/white font which would not be seen until you highlight it. Its for few readers who don’t want spoilers. 

Let’s start a story. Continue reading “A Tale of Governor Limits and Solutions in Salesforce”

10 Salesforce Integration design considerations from Architect point of view – Mind Mapping included

After working on multiple Salesforce implementation project as an Architect, its time to share what I learned from those implementations and would strongly suggest to be considered before designing any “Salesforce Integration”.

Below image shows “integration mind mapping” used by me. I use it to consider some major aspects while discussing integration approaches with enterprise architects in various meetings. This image is very high level however if you think some more points to be considered or have some other thoughts on same, please share.

Salesforce Integration Mind mapping diagram
Salesforce Integration Mind mapping diagram

1. Data Compliance

Lets start with Compliance part first. It is possible that client has confidential data and doesn’t want to move it to Cloud. In that case, we can expose existing web application of Client using some Salesforce products like “Canvas” or “Lightning Connect”.  For Lightning Connect, data needs to be available on DMZ layer however for Canvas it can exist on Intranet and therefore end users can access data only within office, providing flexibility of cloud and security of intranet. Continue reading “10 Salesforce Integration design considerations from Architect point of view – Mind Mapping included”

Resolve 24 hour Apex email limit error in Salesforce

How to design and architect Salesforce application so that 24 hour Apex email limit error could be resolved and have reporting capabilities on emails sent from Salesforce

Sending email from Apex looks very interesting and powerful feature at first glance however by time your application evolves to more complex structure or more data, chances are very high that you will be hitting many Apex email limit related errors. As Salesforce is not mass email sending tool, it makes sense to have limits on total number of outgoing emails per 24 hours.

At a time of writing this post, mainly there would be two types of error while sending email from Apex as explained below

  1. Transaction based errors
    • We can send 100 emails per SingleEmailMessage
  2. Per day (24 hour) email limit
    • We can send 1000 emails per day

One point to note here that we can send unlimited emails to internal users including community users. More details on email limits can be found here (Salesforce governor limits)

I have seen multiple questions on Salesforce developer community on how to resolve error related to sending email per 24 hour in Apex. Below solution has been used by me for a long time and it is working to send thousands of email per day without any problem.

Let’s see how we can resolve this error with below design.

Resolve 24 hour Apex email limit error in Salesforce
Resolve 24 hour Apex email limit error in Salesforce

Continue reading “Resolve 24 hour Apex email limit error in Salesforce”