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

Wrapper Class for a nested query
I have a query which nests the related tasks with a contract. E.g. [Select Id, name , (select Id , subject from tasks ) from contracts].
i know how to create a wrapper class for a query that is not nested but how do I create the constructor class for a query above?
e.g. I would normally have something like
public class wrapper
public contract con {get;set}
public boolean selected {get;set}
public wrapper (contract c)
con=c
i cant seem to use this as the query also includes tasks?
any ideas? Thanks
i know how to create a wrapper class for a query that is not nested but how do I create the constructor class for a query above?
e.g. I would normally have something like
public class wrapper
public contract con {get;set}
public boolean selected {get;set}
public wrapper (contract c)
con=c
i cant seem to use this as the query also includes tasks?
any ideas? Thanks
http://http://www.forcexplore.com/2014/07/relationship-query-in-salesforce.html
if the query was just on contract the constructor would be as above and I would pass in a contract object - public wrapper(contract c). Since I'm passing a query with children it's not accepting the contract object in this wrapper statement for variable c. What should the object type be?