Pagefieldvalue in queryoverride CAML for Sharepoint Publishing page
-
Tuesday, November 22, 2011 9:56 PM
I am having issues setting more than three filters using the queryoverride property. It works just fine if i pass fixed values to the fields like instead of [PageFieldValue:Primary Office], if i feed in 'XYZ Office' then it is able to read that value and pull content based on it...but not with the PageFieldValue...I am trying to pull content from other pages in the page libray that match the primary office value of the current page...so If I am in Doctor X's page and his primary office is XYZ then it should pull all other doctors from XYZ Office, where XYZ office could be the other doctor's primary office or other extra practice location?? Please any sharepoint GURU??
<Query>
<Where>
<And>
<Neq>
<FieldRef Name='Title' />
<Value Type='Text'>[PageFieldValue:Title]</Value>
</Neq>
<Or>
<Eq>
<FieldRef Name='Office' />
<Value Type='Text'>[PageFieldValue:Primary Office]</Value>
</Eq>
<Or>
<Eq>
<FieldRef Name='Office1Name2' />
<Value Type='Text'>[PageFieldValue:Primary Office]</Value>
</Eq>
<Or>
<Eq>
<FieldRef Name='OtherOffice2Name' />
<Value Type='Text'>[PageFieldValue:Primary Office]</Value>
</Eq>
<Eq>
<FieldRef Name='OtherOffice3Name' />
<Value Type='Text'>[PageFieldValue:Primary Office]</Value>
</Eq>
</Or>
</Or>
</Or>
</And>
</Where>
</Query>
All Replies
-
Thursday, December 29, 2011 12:27 AM
Hi AJ Swift,
Perhaps you can try to capture a SQL profiler trace to see if you find any problems with the resulting query into the database.
Also, what error do you see? If you happened to have access to a SharePoint 2010 environment, you can try to add these query criteria in the OOB environment as mentioned here. http://www.glynblogs.com/2010/05/aggregating-items-from-past-7-days-in-sharepoint-2010.html
Cheers,
Jeff
-
Tuesday, March 20, 2012 8:29 AM
AJ
Any luck? I need the answer to the same question. Not happy if the queryOverride does not support filtering by PageFieldValue.
Regards
Henning

