- Issue created by @Swathi257
- πΊπΈUnited States AaronBauman Philadelphia
Looks like whatever has changed exposed an unhandled exception in your CMS_InvoiceItem_Trigger apex class.
I would look into that code for more clues.
Posting the code for two triggers.. We were facing the above issues with these triggers
trigger CMS_InvoiceItem_Trigger on Invoice_Item__c (before insert, before update,
after insert, after update) {String debugName = '--- CMS_InvoiceItem_Trigger ---';
Utils u = new Utils();
Invoice i = new Invoice();
Enrollment e = new Enrollment();Boolean isApiAdminUser = u.isApiAdminUserProfile(UserInfo.getProfileId());
private Boolean sendCmsDebugEmail = new Utils().isDebugCMSTrans(UserInfo.getProfileId());if(isApiAdminUser) {
System.debug(debugName + ' executing....');
if(trigger.isInsert && trigger.isBefore) {
System.debug(debugName + ' ATTEMPTING INSERT....');
i.createInvoiceLineFromCMS(trigger.new);
}
if(trigger.isInsert && trigger.isAfter) {Invoice_Item__c ii;
ii= (Invoice_Item__c)trigger.new.get(0);
//i.debugInvoiceItemRecord(ii, 'After '+debugName+ ' executed and item is inserted.', sendCmsDebugEmail);
i.debugInvoiceItemRecords(trigger.new, 'After '+debugName+ ' executed and potentally MULTIPLE itemS ARE inserted.', sendCmsDebugEmail);//------------- have to link the enrollment obj records to invoice item records here because
//------------- we don't yet have the invoice item ids in the before trigger
List invItemsInserted = trigger.new;
Set invItemIds = new Set();
Boolean atLeastOneClassExists = false;
for (Invoice_Item__c invoiceItem : invItemsInserted) {
if(invoiceItem.Class__c != null) {
atLeastOneClassExists = true;
invItemIds.add(invoiceItem.id);
}
}
if(atLeastOneClassExists) {
i.linkEnrollmentToInvoiceItem(invItemIds);
}
//-------------- done linking.Invoice__c parentInvoice = i.getInvoice(ii.invoice__c);
System.debug(debugName + ' re-locking Invoice and updating origin');
parentInvoice.Status__c = 'Finalized';
parentInvoice.Origin__c = 'CMS Web Order';
update parentInvoice;
}
}
}trigger ClassInstructorImportTrigger on SFDC_Class__c (after insert) {
Utils u = new Utils();
String debugName = '--- ClassInstructorImportTrigger.trigger ---';if(!u.isDisableClassInstructorImportTrigger(UserInfo.getProfileId())) {
System.debug(debugName + ' BEGIN EXECUTING!!!');
Classes cls = new Classes();
cls.addClassInstructors(trigger.new);
System.debug(debugName + ' END EXECUTING!!!');
}