+ Start a Discussion

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:


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!
If possible can you share any of the scenario where you have face the governor limit while developing application ?