function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
THUNDER CLOUDTHUNDER CLOUD 

What are the governor limits that one can face ?

Give me some scenarios where one can hit the governor limits ? 

 
UC InnovationUC Innovation
Here's some documentation on governor limits:

https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm

I would say the most common governor limit issue I see on these forums is putting queries inside loops. Like so:
 
for (contact c: trigger.new)
{
	account a = [SELECT id FROM Account WHERE id =: c.account LIMIT 1];
}
Another common mistake I see is putting DML statements in loops. Like so:
for (contact c: listOfContacts)
{
	update c;
}
This is the kind of code you really want to stay away from. Calling any DML (Insert, Update, Delete, Undelete) or query [SELECT ...] inside loops will often cause governor limits to hit.

For more info please refer to the documentation.

Please mark the best answer if this helped you!
 
THUNDER CLOUDTHUNDER CLOUD
If possible can you share any of the scenario where you have face the governor limit while developing application ?