Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to write an application page that will list the pending workflow tasks for the logged-in user. Is there an object in the SharePoint model I can query to give me a list of the pending tasks for the current user?

share|improve this question
    
In the context of the current site, entire farm, or enterprise-wide? –  Rob D'Oria Aug 14 '11 at 21:51
    
In the current site. –  Clay Acord Aug 14 '11 at 22:33
add comment

2 Answers

There really isn't an API per se...the tasks are recorded in site-specific Task lists. There is an OOB web part (User Tasks under the Social Collaboration category) that shows the tasks for the current user, but if you want to go beyond that you can reference one possible solution in the following post from Waldek:

http://blog.mastykarz.nl/inconvenient-user-tasks-web-part-display-all-tasks/

I know I saw a blog post once on using Linq to query across sites and site collections to get a consolidated task list, but am not able to find it after a quick search.

share|improve this answer
add comment

I had a simailar issue and found this tutorial to be helpful...

http://msdn.microsoft.com/en-us/library/ff742311.aspx

Shows how to query lists using linq. I just changed the where clause to to be

userid = web.AllUsers["username"].ID;
var q = from task in Tasks
        where task.AssignedToId == userid
        select task;
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.