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.
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:
Another common mistake I see is putting DML statements in loops. Like so: 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!
1) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_gov_limits.htm
2) https://developer.salesforce.com/docs/atlas.en-us.salesforce_app_limits_cheatsheet.meta/salesforce_app_limits_cheatsheet/salesforce_app_limits_platform_apexgov.htm
3) https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_limits.htm
Let us know if this will help you