New answers tagged

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 ...


0

This one is an alternative that I prefer to CAMLing with REST, but requires you to have the item ID and list ID. var query = webUrl + '_api/web/lists(guid'<your list ID>')/items(<item ID>)/File; Then you get the document name directly into data.d.Name. I am unsure why CAML wouldn't bring FileLeafRef.


0

To get items from specific folder without receursive add to query this options: <QueryOptions> <Folder>thelist/thefolder</Folder> </QueryOptions> Note to replace thelist/thefolder with actual relative url


2

SP.CamlQuery does not have a property RowLimit , you have to set in the caml markup: camlQuery.set_viewXml("<View><Query> <OrderBy> <FieldRef Name='ID' Ascending='False' /> </OrderBy> </Query> <RowLimit>5</RowLimit> </View>");


1

This might be duplicate of List with > 5000 items working with Paging? Please have a look and let me know whether it is helpful or not Thanks


1

Using Client Object Model, You can query large list by using ListItemCollection Property ClientContext clientContext = new ClientContext("YOURURL"); List list = clientContext.Web.Lists.GetByTitle(“Tasks”); ListItemCollectionPosition itemPosition = null; while (true) { CamlQuery camlQuery = new CamlQuery(); camlQuery.ListItemCollectionPosition ...


2

Create a view in your list. Set a filter on the view to filter the data so the total number of items displayed in the view is less than the threshold, based on e.g. a date range, a number, by item id etc. Then after you can use the ListItemCollectionPosition class to implement paging list item retrieval according to the position of items relative to their ...


1

try this using (SPSite spsite = SPContext.Current.Site) { using (SPWeb web = spsite.OpenWeb()) { SPQuery query = new SPQuery(); SPList list = web.Lists["CalendarList"]; query. ExpandRecurrence = true; // query.RowLimit = 20; ...


1

Another option is to avoid the CAML and use calendar views. According to this blog post, you can create a view that shows recurring events and displays them in chronological order. Then at the end of the view definition, you can limit the view to show the next 2 items. To create the view, go to the calendar and follow these steps: Ribbon -> Calendar -> ...


0

It is quite difficult to make such queries. The documentation is somewhat ambiguous and contradictory in some cases. Finally this query gave me good results. I leave it here in case anyone else is interested. SPQuery consulta = new SPQuery(); consulta.ViewFields = ""; consulta.ViewFields += "<FieldRef Name='Title'/>"; consulta.ViewFields += ...


0

There are two available solutions from the Office Patterns and Practices: https://github.com/OfficeDev/PnP/tree/master/Samples/Core.ListViewThreshold.JSOMAndREST https://github.com/OfficeDev/PnP/tree/master/Samples/Core.ListViewThreshold


1

Resolved by applying below code using (SPSite spsite = SPContext.Current.Site) { using (SPWeb web = spsite.OpenWeb()) { SPList list = web.Lists["CalenderList"]; SPQuery query = new SPQuery(); query.ExpandRecurrence = true; ...


1

You need to format the date like this: Server Site string date = SPUtility.CreateISO8601DateTimeFromSystemDateTime(inputDate); Sample for your case: inputDate = new DateTime(2016,04,18); string date = SPUtility.CreateISO8601DateTimeFromSystemDateTime(inputDate); Client Side (client object model) string date = ...


1

Valid values for DateRangesOverlap are <Year>, <Month>, <Now>. If you want to get future recurrence events for single month than use <Month>. If you want to get future recurrence events for entire year than use <Year>. I assumed here in below updated query that you need current month's results for recurrence events. SPQuery ...


0

I believe the 'In' CAML tag scope only pertains to list FieldRefs see https://msdn.microsoft.com/en-us/library/office/ff625761(v=office.15).aspx


0

Just another input: When working with caml querys, you need to format your date time to the right format. SPUtility gives you 2 important methods: SPUtility.CreateISO8601DateTimeFromSystemDateTime And SPUtility.CreateDateTimeFromISO8601DateTimeString They are really helpful when working with Caml and DateTimes.


1

try this: <Where><And><Gt><FieldRef Name='Date'/><Value Type='DateTime'>" + dTfrom.SelectedDate.ToString("yyyy-MM-ddTHH:mm:ssZ") + "</Value></Gt><Lt><FieldRef Name='Date'/><Value Type='DateTime'>" + dtTo.SelectedDate.ToString("yyyy-MM-ddTHH:mm:ssZ") + ...


0

Yay after much trail and error I found a solution: If looking to search Sharepoint list by variable using CAML & Javascript then the query string below will bring back id (or value if dropdown etc) and field data. The code in my question hasn't changed except the query string: ...


0

You cannot use <Contains> with Lookup columns. Only Text and Note field types are supported. See this MSDN article.


-1

Include your query inside a Where clause/tag. <Where><Contains><FieldRef Name='MyLookup' /><Value Type='Lookup'>test</Value></Contains></Where>


0

I have added one line in your code as context.load(collListItem, 'Include(---- Column name which you need ---)'); Please check it. function GetProdIDbyName(){ var siteUrl = _spPageContextInfo.webAbsoluteUrl; var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('MyListName'); var camlQuery = new ...


0

Answering to self question, may be helpful to others: The approach is, in UserRank list I added Count columns as numeric. After each email from webpart the user count get increment. if user exist then his count increments. if not exist then add user with count 1. Each user entry has its incremental date in datetime column. Now create view on page where I ...


1

Using Linq query, you can get result what exactly you want. var reg = new Regex("\\\bblack\\\b", RegexOptions.IgnoreCase); var result = from item in lst.Items.Cast<SPListItem>() where reg.IsMatch(item["Title"].ToString()) select item;


2

I don't think this is currently possible since it's a comma seperated value. All filtering options are void since searching on exact word contains either 0 or 2 since both contain the word black. Unless I am mistaken CAML Query does not Support removing a character in this case the comma and then search for exact word. if it was space seperated instead ...



Top 50 recent answers are included