I am creating a visual web part for aggregating all task in all webs of a site collection

I am using SPSiteDataQuery to get all tasks but it does not work for Task list


Task List

query.Lists = "<Lists ServerTemplate=\"107\" />";

But it work for custom list

Custom List

query.Lists = "<Lists ServerTemplate=\"100\" />";

Can anyone tell me why this does not work for task lists?

  • What is the scope of your Query? Please post full code – Unnie Sep 2 '15 at 12:14
  • Which version of SharePoint are you using? – Juan Pablo Pussacq Laborde Sep 2 '15 at 12:18
  • Yup issue has been resolved. I am using Task list with Timeline of which serverTemplate is "171". Thanks for Help..!! – Kaushal Khamar Sep 2 '15 at 12:55
  • marking my answer as right would be nice – Leopold Lerch Sep 2 '15 at 14:13

There are 3 List Templates for Tasks:

  • Project (Gantt) Tasks (TemplateId: 150)
  • Tasks (2010) (TemplateId:107)
  • Tasks (TemplateId: 171)

Did you verify that the requested List is using the Template you ask for?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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