You need to sign in to do that
Don't have an account?
guest1231231
List controllers are not supported for Task
Is there a workaround for "List controllers are not supported for Task"?
Thanks
public class ActivityHistorySetConExt { //ApexPages.StandardSetController must be instantiated for standard list controllers public ApexPages.StandardSetController setCon { get { if(setCon == null) { setCon = new ApexPages.StandardSetController(Database.getQueryLocator( [select subject, whoid, whatid, accountid, ownerid, activitydate, description from Task order by activitydate desc limit 1000] ) ); } //setCon.SetPageSize(5); return setCon; } set; } // Initialize setCon and return a list of records public List<Task> getTasks() { return (List<Task>) setCon.getRecords(); } // returns the next page of records public void first() { setCon.first(); } // returns the next page of records public void last() { setCon.last(); } // indicates whether there are more records before the current page set. public Boolean hasPrevious { get { return setCon.getHasPrevious(); } set; } // returns the previous page of records public void previous() { setCon.previous(); } // indicates whether there are more records after the current page set. public Boolean hasNext { get { return setCon.getHasNext(); } set; } // returns the next page of records public void next() { setCon.next(); } }
You can always make a custom controller that does what you need. I've done this before for Tasks.
One thing I ran into in dealing with Tasks is that you can't use ActivityDate to order your query results; this is mentioned in a footnote in the Developers' Guide, and if I'd seen it sooner, it would have saved hours of frustration. This problem may be cleared up soon, I don't know.
Let us know if you need tips on how to do the controller code.
Jeremy