You need to sign in to do that
Don't have an account?
Rahul
can someone please help with the test class of this code please
trigger updatestatus on Task (after insert) {
set<id> setid = new set<id>();
list<contact> lstcon = new list<contact>();
for(task t :trigger.new){
setid.add(t.whatid);
setid.add(t.whoid);
}
for(contact cc :[select id,boolean__C,(select subject from tasks) from contact where id=:setid]){
For(task t1 :trigger.new){
if(t1.subject=='Mass Email'){
Contact cc1 = new contact();
cc1.id=cc.id;
cc1.boolean__c='True';
lstcon.add(cc1);
}
update lstcon;
}
}
}
set<id> setid = new set<id>();
list<contact> lstcon = new list<contact>();
for(task t :trigger.new){
setid.add(t.whatid);
setid.add(t.whoid);
}
for(contact cc :[select id,boolean__C,(select subject from tasks) from contact where id=:setid]){
For(task t1 :trigger.new){
if(t1.subject=='Mass Email'){
Contact cc1 = new contact();
cc1.id=cc.id;
cc1.boolean__c='True';
lstcon.add(cc1);
}
update lstcon;
}
}
}
Hope Below Test Class will work:
Please mark as best answer if helped.
Regards,
Ramakant
All Answers
Hope Below Test Class will work:
Please mark as best answer if helped.
Regards,
Ramakant