Salesforce coding lessons for the 99%
Finally, Apex tutorials for point-and-click admins! Written by a self-taught Google engineer.
  • Beginner Tutorials
    • Apex
    • Certifications
    • Career Info
    • Technical Architect
    • Visualforce
    • Videos
  • Apex Academy
  • Success Stories
  • About Me
  • Misc
    • Mailbag
    • Challenges
    • Links
    • Login to my Org
Follow @dvdkliuor SUBSCRIBE!

What are Governor Limits?

November 17, 2013

Preface: this post is part of the Bulkify Your Code series.

Governor limits are Salesforce’s way of forcing you to write efficient, scalable code.

The good:

  • Governor limits prevent other orgs from writing bad code and taking up all the cloud CPU.
  • Coding limits in general are completely unique to Apex – consider it job security!
  • You have a friend that will teach you how to dominate these limits!

The bad:

  • These are hard limits on your org preventing you, for example, from doing too many SOQL queries in a trigger (max: 100 queries).
  • Upgrading your edition or paying Salesforce more money will not increase your limits! The only workaround is to understand how to navigate around them.

The ugly:

  • Whether you like it or not, you will run into governor limits!

There’s no need to be intimidated though, getting around governor limits isn’t difficult and there’s always a way around them. Plus, after this chapter, you will be the governor limit master!!

Coming soon to a theater near you!
Mean Girls 2: The story of two best frenemies – the Salesforce developer and governor limits!

Next post: We write an inefficient Apex trigger and fix it!

9 Comments
Sonia
March 3, 2016 @ 11:05 pm

Hi David..

Please post some project related interview Q&A..

Thanks
Sonia

Reply
    David Liu
    March 3, 2016 @ 11:05 pm

    There’s going to be a ton in the Apex Academy!

    Reply
kuchan vinodkumar
July 20, 2014 @ 2:09 am

hi david i want to write code for updating the account records using account_id how can i write the code…

Reply
    David Liu
    July 27, 2014 @ 10:06 pm

    Practice, practice, practice!

    Reply
Karthick
July 2, 2014 @ 11:36 pm

Hello david,
Can you teach me the salesforce objects(for administration ) and how they are related to each other(like where its starts and where its ends)

Reply
    David Liu
    July 3, 2014 @ 10:45 am

    There’s got to be some good documentation out there – I only focus on code sorry!

    Reply
Ramana
December 20, 2013 @ 12:14 pm

I fall in love with this site. Awesome resource for beginners,

Reply
Graham
December 6, 2013 @ 2:10 am

Hi David,

Just wanted to say thank you again for your posts. This is by far, the best resource for beginners trying to learn Apex on the entire web (And I have searched through a lot of them). No other site explains what each line of code is doing and why in such an easy to understand way. If you were running online classes or webinars, I am sure you would have hundreds of people signing up. I know I would. (something you might consider hopefully) I also think I would be confident writing effective triggers containing SOQL queries in about 2 weeks if your classes contained content like this site!!! Please continue to write and if possible, include some more exercises (Write a trigger to do this……etc). For me anyway, the best way to learn is just to start writing triggers and then try to understand why it is or isn’t working. Sadly, I am short on ideas on sample triggers to write so if you have any exercises, I would really appreciate it.

Thanks again.
Graham

Reply
    David Liu
    December 7, 2013 @ 10:48 am

    Hey Graham,

    So glad you’re enjoying my site! The online classes are a great idea! Maybe one day in the future when I have more viewership!

    Try writing a trigger that counts the number of tasks on the record =)

    David

    Reply

Leave a Reply Cancel reply

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


*

*

Theme: Simple Style by Fimply