0

I am using the CQW to display all tasks in the site collection that is assigned to a user and not marked 'Completed'. I used the out-of-the-box query and customized an XSL stylesheet to display the results as required. However, the query does not return results for all users (even though they have tasks assigned to them).

I believe the issue is with the [Me] variable - maybe it is not correctly identifying the users in AD? Either way, to attempt to resolve that issue: in designer I added a custom query to the QueryOverride property (see code below). However, when I added the QueryOverride I started to get "No Results Found". I tried encoding the query - no luck. I suspected increasing the number of lists the query runs through would help (see code below) - still no help. I currently see, "There is a problem with the query that this Web Part is issuing. Check the configuration of this Web Part and try again". enter image description here

Have you been able to successfully override the query in the CQW? Is there an error in my code I am overlooking?

Custom Query:

<![CDATA[<Where><And><Eq><FieldRef Name="AssignedTo" LookupId="TRUE"/><Value Type="User"><UserID/></Value></Eq><Neq><FieldRef Name="TaskStatus" LookupId="TRUE"/><Value Type="Choice">Completed</Value></Neq></And></Where>]]>

HTML Encoded Query:

<property name="QueryOverride" type="string">&lt;![CDATA[&lt;Where&gt;&lt;And&gt;&lt;Eq&gt;&lt;FieldRef Name=&quot;AssignedTo&quot; LookupId=&quot;TRUE&quot;/&gt;&lt;Value Type=&quot;User&quot;&gt;&lt;UserID/&gt;&lt;/Value&gt;&lt;/Eq&gt;&lt;Neq&gt;&lt;FieldRef Name=&quot;TaskStatus&quot; LookupId=&quot;TRUE&quot;/&gt;&lt;Value Type=&quot;Choice&quot;&gt;Completed&lt;/Value&gt;&lt;/Neq&gt;&lt;/And&gt;&lt;/Where&gt;]]&gt;

ListsOverride:

<![CDATA[<Lists ServerTemplate="850" MaxListLimit="2000"></Lists>]]>

Your Answer

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

Browse other questions tagged or ask your own question.