trigger SoM_RequestCancelledOnFeePayment on SoM_Request__c (after update) {
if (!SoM_Utilities.gs.Disable_Triggers__c) {
List<MUSW__Fee_Payment__c> feePymtsToUpdate = new List<MUSW__Fee_Payment__c>();
List<MUSW__Fee_Payment__c> fpList = [SELECT Id, Name, CreatedDate, SoM_License__r.MUSW__Type__c, SoM_Request__r.SoM_Status__c
FROM MUSW__Fee_Payment__c
WHERE SoM_Request__c IN :Trigger.OldMap.KeySet() AND SoM_Request__r.SoM_Status__c = 'Cancelled' AND SoM_License__r.MUSW__Type__c = 'Special 24-hr License'];
//system.debug(JSON.Serialize(fpList));
for(MUSW__Fee_Payment__c fp : fpList){
if(fp.SoM_License__r.MUSW__Type__c == 'Special 24-hr License'
&& fp.SoM_Request__r.SoM_Status__c == 'Cancelled'){
fp.Request_Cancelled__c = True;
}
feePymtsToUpdate.add(fp);
}
if(feePymtsToUpdate.size()>0){
Update feePymtsToUpdate;
//System.debug('Fee Payments to Update: '+feePymtsToUpdate);
}
}
}
There's no Query or DML involved in the FOR loop yet i am getting Too many SOQL queries: 101 error. fpList is at Line 12
Could someone help me understand what else would result to this issue. There are multiple triggers on the same object and multiple triggers on other objects as well which is querying SoM_Request__c object. i am working on a trigger pattern right now to avoid multiple triggers but is that something that could be a possible root cause for this issue?