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
TinkuTinku 

SOQL Governer Limit with Trigger

In my Organization there are totally 4 triggers on Opportunity and 4 triggers on Account. Each trigger fires 2 or 3 SOQL statements. None of the triggers have SOQL statements inside For or If loop.

 

When i create a Opportunity, it fires all these 8 triggers and thus hitting Governer Limits.

 

Any suggestions on How to proceed from here?

 

 

dsh210@lehigh.edudsh210@lehigh.edu

If you are accessing the same or similar data, I would suggest making some singleton methods to create maps. I had this issue too and using maps solved it.

 

If you are not familiar:

 

Map Info: http://download.oracle.com/javase/1.4.2/docs/api/java/util/Map.html

 

Singleton Info: http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns.html

 

I made one Apex class to hold these singleton methods so I could call them from my triggers.

 

-DH

forecast_is_cloudyforecast_is_cloudy

In Spring 11 (rolling out in February), there are no separate set of governor limits for the trigger context. You will be able to make upto 100 SOQL calls (even in a trigger context) starting in Spring 11. I would just wait for that release and not modify any existing code.