New answers tagged caml
0
I got it working with the code here (from the solution post)
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentprevious/thread/120c875a-5240-45cc-a587-c6e376872315
2
It should look something like this (don't quote me because I haven't tested this):
<Where>
<Or>
<Eq>
<FieldRef Name="File_x0020_Type" />
<ValueType="Text">pdf</ValueType>
</Eq>
<Eq>
<FieldRef Name="ContentTypeId" />
...
2
Use this field in your CAML query: File_x0020_Type. Compare it to pdf as a fixed value. For folders you can try ContentTypeId eq 0x0120.
1
A "workaround" is maybe to add an ContentType check in your ListEnumerator.moveNext()
If you change the following:
ctx.load(this.allDocumentsCol, "Include(FileLeafRef, ServerUrl, ContentType)");
And:
while(ListEnumerator.moveNext())
{
var currentItem = ListEnumerator.get_current();
var ct = currentItem.get_contentType();
...
2
Site columns in content types is a great way to group several columns in a meaningful (and reusable) way, and then attach the content types to the list. Having said that, you can define all the site columns in one file (Say SiteColumns.xml) and user FieldRef to reference them in your content types (say ContentTypes.xml). You can always ensure to activate ...
1
Use the SPUtility.CreateISO8601DateTimeFromSystemDateTime() in all your date time value so that your CAML query would work. for usage instruction see this Link
0
The thing is when you call clientContext.load(listItems,CS) you retrieve just particular set of columns - this doesn't include ListItemCollectionPosition. If you check the response in any http debugger you'll see that. If you need paging information and limit columns to just what you need I suggest you to use ViewFields sub-element of View element and not ...
1
Contains is not exact - what happens if you have multiple Williams?
<Where>
<Includes>
<FieldRef Name='Initiators' LookupId='TRUE'/>
<Value Type='Integer'>7</Value>
</Includes>
</Where>
Where 7 is the ID of the SPUser of Williams.
-1
The answers is Contains. Also, if i put williams, berry it works.
<Contains>
<FieldRef Name="Initiators" />
<Value Type="UserMulti">williams</Value>
</Contains>
1
Check this post. The main point is to use "RowLimit" in your query:
query = new SP.CamlQuery();
query.set_viewXml("<View><RowLimit>10</RowLimit></View>");
And set listItemCollectionPosition property:
var position = new SP.ListItemCollectionPosition();
position.set_pagingInfo("Paged=TRUE&p_ID=1"); //to get items from the ...
2
AssignedTo should be replaced with Author and you should then see all your items.
0
Change <Value Type='Boolean'> to <Value Type='Text'> or <Value Type='MultiChoice'>.
Source:
http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopmentprevious/thread/b20b1945-4b73-4320-8666-957650dc6a20
0
CAML and Querying Boolean Fields
By Erkka PeltoniemiFebruary 22 201016 comments
Today I had some trouble trying to filter out items by a field of type Boolean. I have a custom content type definition which has a FieldRef to a Field:
<Field
Type="Boolean"
DisplayName="IsHeadlineDisplayName"
Description="IsHeadlineDescription"
Required="TRUE"
...
1
The dates look malformed, you need to use ISO format: yyyy-MM-ddTHH:mm:ssZ
0
If the field "My Products" exist in the site with the same ID so you should add just a reference to this field. I mean you should use <FieldRef >.
Otherwise try to change the ID and the Name of your new field.
0
once i wrote a class that create caml query very easily by a simple syntax.
If you dont want to lost in caml syntax, this class (i name it as cawl4SharePoint) is an option.
https://github.com/makdeniz/cawl4SharePoint
5
<OrderBy>
<FieldRef Name='Region' Ascending='True' />
<FieldRef Name='Location' Ascending='True' />
</OrderBy>
Should be the correct syntax for the order by clause.
Top 50 recent answers are included


