You need to sign in to do that
Don't have an account?
Shephali Swarnkar
Unexpected Error
I am getting the following Error:
[Error] Error: agent_task Compile Error: Illegal assignment from List<Task> to List<Task> at line 9 column 6
Please help me to figure it out:
public class task_list
{
public String str{get;set;}
public list<task> tasklist{get;set;}
public task_list()
{
str=UserInfo.getname();
tasklist =[Select subject,Priority, status, ActivityDate,CreatedBy.Name,Owner.Name,Who.Name,Description, ReminderDateTime from task where Owner.name= :str];
}
}
[Error] Error: agent_task Compile Error: Illegal assignment from List<Task> to List<Task> at line 9 column 6
Please help me to figure it out:
public class task_list
{
public String str{get;set;}
public list<task> tasklist{get;set;}
public task_list()
{
str=UserInfo.getname();
tasklist =[Select subject,Priority, status, ActivityDate,CreatedBy.Name,Owner.Name,Who.Name,Description, ReminderDateTime from task where Owner.name= :str];
}
}
Thanks For Reply.I fixed the error i got
In my DE somewhere I have created a class named "task". Thats why the compiler wasnot able to understand that it is standard Object "Task" or the class created by Me. I renamed that class, it is working Now.
Thanks Shephali
All Answers
I succesfully save you class in my dev org, can you try save file throught salesforce(Setup -> Develep-> Apex Classes -> New).
As a common practice, if your question is answered, please choose 1 best answer.
But you can give every answer a thumb up if that answer is helpful to you.
Thanks,
Alex
Try with below code
When exactly you are getting this error ?
Let me know if it helps !!
Thanks
Manoj
Thanks For Reply.I fixed the error i got
In my DE somewhere I have created a class named "task". Thats why the compiler wasnot able to understand that it is standard Object "Task" or the class created by Me. I renamed that class, it is working Now.
Thanks Shephali