You need to sign in to do that
Don't have an account?
Deepak agarwal 9
Error on task list
trigger deleteoppafter on Opportunity (after delete) {
if(trigger.isafter && trigger.isdelete){
list<task> t=new list<task>();
t=[select whatid from task];
for(opportunity opp1:trigger.old){
for(task tt:t){
if(opp1.id==tt.whatid){
t.add(tt);
delete t;
}
}
}
}
}
i am getting the following error:
Illegeal assignment from list to list.
Please help..!!
if(trigger.isafter && trigger.isdelete){
list<task> t=new list<task>();
t=[select whatid from task];
for(opportunity opp1:trigger.old){
for(task tt:t){
if(opp1.id==tt.whatid){
t.add(tt);
delete t;
}
}
}
}
}
i am getting the following error:
Illegeal assignment from list to list.
Please help..!!
Is there any class exist in your org with "task" name? may be that can be issue.
Thank You,
Hitesh Patel
Email :- hiteshpatel.aspl@gmail.com
http://mrjavascript.blogspot.in/
I put in fake selection criteria to protect the innocent (data), so just focus on the last two lines for what you need.
Let us know if this will help you
No there is no class by name task,but i am confused that class cannot be created in salesforce right??only objects can be
Thank you very much for the help.. But iam getting the same error. MIght be there is a problem in my org,code is fine.
Tell me if you come across any other help.Also sometimes iam getting the error like 'whatid' doesnot exists in tasks.
My intention is to delete all actvities associated with the opportunites.(using trigger event after delete).
thanks for the help.Apex class task was already existingin my org so it got cleared.thanks once again
Thank You,
Hitesh Patel