Roland Oldengarm - Independent IT Contractor

Living in the coolest little capital Wellington, New Zealand!

Category: WebParts

SPSiteDataQuery: The property Query contains an invalid value.

Just ran into the following issue: created a big query, which was working fine. Made a minor change and ran into the following exception: The property Query contains an invalid value.]

 [SPException: The property Query contains an invalid value.]    
Microsoft.SharePoint.SPSiteDataQuery.ReportInvalidProperty(Exception ex, String strProperty) +118    
Microsoft.SharePoint.SPSiteDataQuery.ValidateXmlProperty(String strXml, String strPropertyName, String strTag, String strTag2, String strTag3) +366    
Microsoft.SharePoint.SPSiteDataQuery.get_ViewXml() +203    
Microsoft.SharePoint.SPWeb.GetSiteData(SPSiteDataQuery query) +394

This error normally indicates you made an XML-error, like not closing a <FieldRef>. That was not the case. I logged all query-parameters, copy-pasted to PowerShell and it was working like a charm there.

After spending hours I noticed that the Query-parameter started with a whitespace! After removing that, error was fixed…. So, no enters and/or white space at the start of the Query-parameter. It doesn’t matter how many you have inside the query, but nothing at the start.

SPSiteDataQuery no results?

When you execute a SPSiteDataQuery with some filter-fields and you receive no results, while you expect some, please add the filter-fields also to the view-fields….

Contentbyquerywebpart, displaying value of Associated Lookupfield: “Attempted to use an object that ceased to exist”

The case: The customer wants to create news pages and select a category out of a dropdown. Each category has an associated image which has to be shown in an overview. No code allowed. Thus, lookup list, contentbyquerywebpart, image library, should work like a charm… But, no…

Continue reading

WhatsPopularWebPart: render titles instead of URL’s

SharePoint 2010 has a nice new webpart, the WhatsPopularWebPart. I have used it to show me the most frequent viewed pages. However, SharePoint displays the URL of the page instead of the Title! Using Reflector I stepped into the code and in some private method I saw they just render the URL. I’ve got a solution by overriding the webpart Continue reading