New answers tagged

0

A great tool to use to craft, test, and validate is the BIWUG CAML Designer. It can be found on their web site, http://www.biwug.be/resources. It has been highly invaluable when working with both client side and server side code.


0

<View Scope="RecursiveAll"> <ViewFields> <FieldRef Name="FileLeafRef" /> <FieldRef Name="FileDirRef" /> <FieldRef Name="ItemChildCount" /> </ViewFields> <Query> <Where> <Eq> <FieldRef Name="FileDirRef" /> <Value Type="Text">/sites/devsite/Shared ...


1

Written a console for you. You can use it as per your need static void Main(string[] args) { using (SPSite site = new SPSite("http://spserver:1111/")) { using (SPWeb web = site.OpenWeb()) { SPList lib = web.Lists.TryGetList("TestLibrary"); SPQuery query = new SPQuery(); ...


0

Syntax and a working solution Works in SP 2013. Geq&gt;&lt;FieldRef Name=&quot;EventDate&quot;/&gt;&lt;Value Type=&quot;DateTime&quot;&gt;&lt;Today OffsetDays=&quot;-30&quot;/&gt;&lt;/Value&gt;&lt;/


0

Try This <View> <Query> <Where> <Contains> <FieldRef Name='Title'/> <Value Type='Text'><UserID/></Value> </Contains> </Where> </Query> </View>


2

Base on your code, the value you get is a string not an object. so the code : var relateditmid = relateditm[0].ItemId; will return the item ID after converting the string relateditm to Object using eval funtion. var relateditmObj = eval(relateditm); var relateditmid = relateditmObj[0].ItemId;


2

Try this : ---> createdDate.ToString("s")


2

Please note that date you are passing in CAML query need to be in ISO8601DateTime format. string createdDate = startDate.ToString("yyyy-MM-ddTHH:mm:ssZ"); then pass this in CAML query. Reference: http://www.codeproject.com/Articles/414414/SharePoint-Working-with-Dates-in-CAML


1

A CAML query for that would look something like this <View> <Query> <Where> <Contains> <FieldRef Name='Title'/> <Value Type='Text'>username</Value> </Contains> </Where> </Query> </View> But I do wonder why you ...


1

Try using SPList.GetDataTable method MSDN: https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splist.getdatatable.aspx public DataTable GetDataTable( SPQuery query, SPListGetDataTableOptions flags, out SPListItemCollectionPosition position ) With this method you can read with a single query all the information in a c# datatable. ...


0

Simpler CAML - items created by current user query.Query = @"<Where> <Eq> <FieldRef Name='Author' /> <Value Type='User'><UserID/></Value> </Eq> </Where>";


0

You can pass your CAML query to this endpoint: http://<sitecollection>/<site>/_api/web/lists(listid)/getItems(query) For low level details, refer this answer


0

Since you are using executeQueryAsync method of SharePoint it will process the request aysnchronously. Have a look at jquery Deferred variable to control your aynchronous operations. Sample code: var deferred = $.Deferred(); for(var i = 0; i < result.length; i++){ queryList(i).done(function(resultArr) { MasterProjectDataSuccess(); }) .fail(function(){ ...


2

The CAML would look like: <Where> <Eq> <FieldRef Name='booleanField' /> <Value Type='Boolean'>0</Value> </Eq> </Where> If you are going to be building a lot of CAML queries, I'd highly recommend picking up the CAML Designer from http://www.biwug.be/resources.


0

I have answered on this question: Files move from one library to another library using jsom Here i have set array globally. Push and load the item one by one in array with Looping of itemcollection Get array result in executeQueryAsync-success function


2

Each list keeps its own IDs and you will not be able to keep them perfectly in sync. Create a helper columns and let the workflow copy the ListA ID into that field, then refer to that field as the common ID. If you use the workflow step "Create item" instead of copying an item, you can transfer any field value from the current item to the new item, as ...



Top 50 recent answers are included