Governor Limits

If you work with Salesforce and read the documentation, it doesn't take long to learn that Salesforce is a multi-tenant environment, and to allow many orgs to host on a single server, governor limits are necessary.

While this could seem like a Salesforce-specific issue, the concept is not entirely unfamiliar to almost any server-base platform. Servers grind to a halt when too much work is required of them.

When Salesforce sees you have exceeded your limits, it will throw exceptions and rollback any changes that are part of the current transaction.

...orgs that are developed with poor practices often have very week Apex testing making optimization that much more difficult.

To complicate matters, even though an exception is thrown, there is no way to catch the exception and provide an alternate path, though you can write code to see how close you are to hitting a limit and provide an alternate solution. In practice this is rather difficult, and the process of constantly looking for limits could be the cause of hitting them.

Some limits are hard limits, meaning a process may fail mid-stream; others are soft limits, meaning you'll only get a warning. Some limits are per rolling 24-hour periods while others are per user transaction.

Often issues related to limits cannot be solved with a simple code change. Usually, though not always, limits issues are death by 1000 cuts. It will be much better to utilizes best practices throughout the development process, than to attempt to fix things as an afterthought.

My personal observation is that orgs that are developed with poor practices often have very week Apex testing making optimization that much more difficult.

 

 

© 2001 – 2023 Object Factory Inc
marker marker marker marker marker