You need to sign in to do that
Don't have an account?
guest1231231
Rendering Child Object From List Controller
How do you render a subquery from a custom list controller? I want to render fields from ActivityHistories for the current account. ***I also need to have pagination.***
Thanks
Here is my current code:
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 id, name, ownerid, (select subject, whoid, whatid, accountid, ownerid, activitydate, description from ActivityHistories order by activitydate desc limit 1000) from account where id = :ApexPages.currentPage().getParameters().get('id')] ) ); } //setCon.SetPageSize(5); return setCon; } set; } // Initialize setCon and return a list of records public List<Account> getAccounts() { return (List<Account>) 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(); } }
Check this link
http://community.salesforce.com/t5/Apex-Code-Development/How-to-display-a-Subquery-in-a-visualforce/m-p/179606#M28413
Thanks but that doesn't solve the pagination problem.
Next and Previous methods are returning as null so it's not possible to view all of the activityhistories list, which is needed.
Here is VF page which is not returning all activityhistories....
There is no mechanism to get the pagination controls for child objects currently.
This is an unfortunate but known limitation.
Thank you for your post mtbclimber.
As I understand it, the Task object can not be called from a List Controller. Currently, is there any workaround to create pagination for the task object?
Basically what is needed is a VF page which returns account activities assigned to certain users with pagination. I've already created a VF page that returns account activities assigned to certain users but some accounts have hundreds and hundreds of records which makes the page very very slow and almost useless. Pagination on the Task object is badly needed.
Thanks