AquaLogic Interaction Development Kit (IDK) 6.0.0 |

# ITaskListManager.QueryTaskLists Method

Returns `ITaskList` array in the given project based on the `ITaskListFilter`.

ITaskList[] QueryTaskLists(
IProject project,
ITaskListFilter taskListFilter
);

#### Parameters

project
  The project to query task lists from; cannot be `null`.
taskListFilter
  The task list filter to construct the query; cannot be `null`.

#### Return Value

An `ITaskList` array of objects in the given project.

#### Remarks

The following sample code shows how query for task lists in a project.

    ITaskListFilter taskListFilter = tasklistManager.CreateTaskListFilter();

    //set the query to search for all task list
    //different options can be set to search on task lists that contain only PENDING tasks,
    //completed tasks, or overdue tasks.  See documentation in TaskListCompletionFilterType
    taskListFilter.CompletionType = TaskListCompletionFilterTypes.All;

    //limit the return results to be 10; setting this to 0 will return all results
    taskListFilter.MaximumResults = 10;

    //disable security checking on the returned objects against the user who performs this query,
    //so that all objects will be returned
    taskListFilter.RestoreSecurity = false;

    //user TaskListQueryOrder to sort the query result; below TaskListQueryOrder shows sorting the returned task lists by NAME in ascending order
    TaskListQueryOrder taskListQueryOrder = new TaskListQueryOrder(TaskListAttributes.Name, true);
    taskListFilter.QueryOrders = new TaskListQueryOrder[]  { taskListQueryOrder } );

    //an array of ITaskList objects are returned from queryTaskLists(); if no result is retrieved, a zero-length array will be returned
    ITaskList[] retrievedTaskLists = tasklistManager.QueryTaskLists(project, taskListFilter);

#### Exceptions

Exception Type | Condition
--- | ---
CollaborationException | The method call resulted in an error.
InvalidOperationException | The project has not yet been stored or has already been removed.
SoapException | There was a communication problem during the execution of the remote method call.

#### See Also

ITaskListManager Interface | Plumtree.Remote.PRC.Collaboration.Tasklist Namespace