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 am having some problems with the values getting returned for calculated and url fields when I query multiple lists with SPSiteDataQuery.

The values for these fields are no longer returned in the standard format. For a calculated field the value is a direct match instead of datatype;#value and for a url field only the url is returned, the description is missing.

It seems that as soon as I cut the query down to a only lists with a calculated field in them then the values are fine (all calculated fields are returned properly then, not just the ones in both lists).

The main problem is with the calculated fields, as SPFieldCalculated.GetFieldValueAsText throws an exception when the data type is missing - SPFieldUrlValue works fine.

Has anyone seen this behavior before?

share|improve this question
add comment

2 Answers

Yes there is a bug with the SPSiteDataQuery class. See the links below.

http://sharepointfieldnotes.blogspot.com/2009/09/spsitedataquery-limited-to-10-document.html

http://sharepointfieldnotes.blogspot.com/2009/09/spsitedataquery-limited-to-10-document_08.html

share|improve this answer
    
Hi Steve, Thanks for the reply, but in my case I see this effect when I query two lists. I will be redoing my development site in the next few days and will try and narrow down the problem to see if it is the same issue. Thanks again Calum –  Anonymous May 10 '10 at 22:05
add comment

Hey Calum, Did you find a solution to this?

I am facing a similar issue when querying two different basetypes (Doc library and list) using the query. The results are retruned if I query them individually but the query fails the moment I mention the list IDs for the both the lists together in the list xml.

Thanks Gaurav

share|improve this answer
    
Hi Gaurav, I've been working on the client-side of my project for the last couple of months but need to sort this problem out inside the next 2-3 weeks before the deadline. I'll let you know as soon as I'm back on the case. Cheers Calum –  Anonymous Aug 23 '10 at 17:05
add comment

Your Answer

 
discard

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