- 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!!!');
}- 🇮🇳India divyat
Hey, from your error this looks like the CMS_InvoiceItem_Trigger is failing during a BeforeInsert operation.
A utility class named Utils used inside the trigger has a syntax issue - likely a type mismatch between List vs List
. Can you pls try below solution 1. Fix Apex Code - Go to Salesforce Developer Console, Open Utils class and look at line 84, column 23. Check the assignment around that line - fix the list type mismatch. List accList = someOtherList; // might be List // Fix: ensure both sides of assignment are same type 2. Recompile the class. 3. Retest Push from Drupal. If this doesn't work, pls share the error you are recieving after fixing the apex. Will investigate more on this.