You need to sign in to do that
Don't have an account?
Luik Lara
Receiving Error: Compile Error: Invalid type: ActivityUtils at line 8 column 5
Hi! I am very new to triggers and can not figure out what is wrong with this. I am receiving this error: Error: Compile Error: Invalid type: ActivityUtils at line 8 column 5 when trying to add a trigger to the task object that will allow my custom field (on the lead) to count how many closed tasks there are.
trigger NVMTaskTrigger on Task (after insert, after update, after delete, after undelete) {
sObject[] triggerRecords;
if(!trigger.isDelete) triggerRecords = trigger.new;
else triggerRecords = trigger.old;
//Update Open Activity Count
ActivityUtils au = new ActivityUtils(triggerRecords);
au.updateAccountActivityCount();
au.updateContactActivityCount();
au.updateLeadActivityCount();
au.updateOpportunityActivityCount();
au.updateCaseActivityCount();
}
trigger NVMTaskTrigger on Task (after insert, after update, after delete, after undelete) {
sObject[] triggerRecords;
if(!trigger.isDelete) triggerRecords = trigger.new;
else triggerRecords = trigger.old;
//Update Open Activity Count
ActivityUtils au = new ActivityUtils(triggerRecords);
au.updateAccountActivityCount();
au.updateContactActivityCount();
au.updateLeadActivityCount();
au.updateOpportunityActivityCount();
au.updateCaseActivityCount();
}
Why you are using ActivityUtils type?