I am experiencing an Apex Cpu Limit and as per checking am I correct that it is in the opportunitytrigger? shoudl I optimize it more?
if(Trigger.isBefore){
if(Trigger.isInsert){
OpportunityTriggerHandler.setOppProposalNumber(trigger.new);
OpportunityTriggerHandler.setOppProjectEndDateBeforeInsert(trigger.new);
OpportunityTriggerHandler.updateOpportunityCodeOnInsert(trigger.new);
if (OpportunityTriggerHandler.donotRunTBPforSomeTestClasses)
OpportunityTriggerHandler.TimeBasedPipelineProcessingBeforeInsert(trigger.new);
OpportunityTriggerHandler.leadConversionBeforeInsert(trigger.new);
}
if(Trigger.isUpdate){
for (integer i = 0; i < trigger.new.size(); i++) {
if (trigger.new[i].Pricebook2id != trigger.old[i].Pricebook2id)
trigger.new[i].Expected_Commitment_Date_Check__c = TRUE;
}
if(tcsetting.editedFromAccount__c == false){
OpportunityTriggerHandler.setOppProjectEndDateBeforeUpdate(trigger.New, trigger.OldMap);
OpportunityTriggerHandler.updateOpportunityCodeOnFieldChange(trigger.NewMap, trigger.OldMap);
if(OpportunityTriggerHandler.firstRun && OpportunityTriggerHandler.donotRunTBPforSomeTestClasses){
OpportunityTriggerHandler.TimeBasedPipelineProcessingBeforeUpdate(Trigger.New, Trigger.OldMap);
}
}
OpportunityTriggerHandler.leadConversionBeforeUpdate(trigger.new);
}
if (Trigger.isDelete){
OpportunityTriggerHandler.delOppLightRecord(trigger.old);
OpportunityTriggerHandler.UpdateAccountPlanTotalDF(trigger.old);
}
}