I am getting a exception
System.Exception: Too many record type describes: 101
I understand this is a governor limit exception.
There are couple of places where i am checking for record types in a If statement in the trigger.
for(Opportunity o : Trigger.new)
{
if ( ( o.TotalOpportunityQuantity != Trigger.OldMap.get(o.Id).TotalOpportunityQuantity) && o.RecordTypeId == varRectype)
{
// do something
}
// i am also checking in another if statement for o.RecordTypeId == varRectype with a combination of other fields.
}
Has anybody else got this error. Any pointers on what is causing this would be of great help
You should open the Developer Console, and repeat the action that caused this exception. Then look at the debug log, to see at which point this Exception is firing. The code you listed above should not be triggering this governor limit, as it has nothing to do with “describe”.
Also, do you have any managed packages installed? The code in those could be triggering this governor limit. Debug log would tell you more.