You need to sign in to do that
Don't have an account?

Visualforce Page help
Hello all,
I am writting a visual force page for the task object, to display some activitives in a different page based on the Subject.
This is the error i am getting with my code. Can anyone point me in the rigth direction please:
Error: Compile Error: Illegal assignment from LIST<Task> to LIST<Task> at line 19 column 4
public class MarketingGeniusTasksController
{
List<Task> tk;
public MarketingGeniusTasksController(ApexPages.StandardController Controller)
{
}
Public List<Task> getResults()
{
return tk;
}
public PageReference gettk()
{
String userId=UserInfo.getUserId();
UserId=userId.Substring(0,15);
System.debug('UserId=='+UserId);
tk=[Select Status, Subject, Priority, OwnerId, Owner.Name, WhatId, What.Name, WhoId, Who.Name, Vmail__c, RecordTypeId, LastModifiedDate, from Task where Subject='Enterprise Marketing Genius Email']; --> Line 19 error
return Null;
}
Static testMethod void testMarketingGeniusTasksController()
{
user testUser=[Select Id from user where ProfileId='00e30000000eFWd' AND IsActive=true Limit 1];
ApexPages.StandardController sc = new ApexPages.StandardController(testUser);
System.RunAs(testUser)
{
MarketingGeniusTasksController testMGT = New MarketingGeniusTasksController(sc);
testMGT.gettk();
testMGT.getResults();
}
}
}
it sounds like you either have a class in your org called "List" or a class in your org called "Task"
All Answers
it sounds like you either have a class in your org called "List" or a class in your org called "Task"
query also needs to be modified .
tk=[Select Status, Subject, Priority, OwnerId, Owner.Name, WhatId, What.Name, WhoId, Who.Name, Vmail__c, RecordTypeId, LastModifiedDate from Task where Subject='Enterprise Marketing Genius Email']; --> Line 19 error
Comma removed afer the LastModifiedDate field
Thank you!
I could never have figured that out. There was actually a class named 'Task'.
thank you TechForce, for the suggestion. But even without the comma in the SOQL query, it was still giving me the same error. Thanks again!