Tag Info

New answers tagged

1

You should pass a SPQuery object to the GetItems method. In the query attribute you have to put just the <Query> tag. Use: SPQUery query = new SPQuery(); query.Query = "" //your <Query>...</Query> tag //for all your view field query.ViewFields ="<FieldRef Name='ID'/>" To specify the row limit use: query.RowLimit = 100; To ...


0

While there appear to be some other issues with the code you could concat your string like so: var query = "<Query>" + "<Where>" + "<Eq>"+ "<FieldRef Name='Audience' />"+ "<Value Type='MultiChoice'>"+subsite+"</Value>"+ ...


1

We need to be careful about the Async calls. I would suggest don't call getCurrentLoginUserDetails() immediately, Let getCurrentUser() complete its async call and then you can proceed with your function to retrieve list items based on LoggedInUser. So based on above explanation, I can propose following solution. Improvements in your function ...


1

In that case you don't need to specify CamlQuery.FolderServerRelativeUrl property at all. The following example demonstrates how to retrieve items of top folder in List: var list = ctx.Web.Lists.GetByTitle(listTitle); var items = list.GetItems(new CamlQuery()); ctx.Load(items); ctx.ExecuteQuery(); If you are interested in returning only items associated ...


1

You just need this: SPQuery query = new SPQuery(); SPListItemCollection myItems = list.GetItems(query); By default you get the files under the root folder. Scopes in a CAML Query


0

You could use SP.ListItem.fieldValuesAsHtml property to get the values for the list item as HTML, for example: ctx.load(items,'Include(FieldValuesAsHtml)'); //retrieve FieldValuesAsHtml property ctx.executeQueryAsync( function() { for(var i = 0; i < items.get_count();i++){ var item = items.get_item(i); var statusText = ...


1

As far as I see, the value of the _ModerationStatus is stored as numbers, corresponding the values in the SPModerationStatusType enumeration. You can translate the numerical values by defining your own moderationStatusType array in JavaScript as shown below: var moderationStatusType = [ "Approved", "Denied", "Pending", "Draft", "Scheduled" ]; var ...


2

I don't think you use the correct columns' names. You're using the names as seen by the SharePoint search engine, not the internal names of the fields. For instance, ows_Title should be Title, etc. On the other side, I don't think the nested OR are wrong here, they're just up-side-down.


2

The whole Or section looks wrong, try using BIWUG CAML Designer to craft your query, then use that in your SPServices function. Also, you need to use the internal field names, not the web service returned fields (Description1 vs ows_Description1 etc). http://www.biwug.be/resources Typical nested Ors would look like this: <Where> <Or> ...


1

There is a GUI editor on Visual Studio Gallery CAML Query Builder


0

Option 1: Since you are getting all the items in the list then the caml query would not be of any use now. TaxonomyFieldValueCollection test = item["TaxonomyFieldName"] asTaxonomyFieldValueCollection; Now loop in the test collection variable to get all the taxonomy values present in the field. foreach (var taxonomyValue in test) { if(taxonomyValue.Label ...


1

Use SPUtility.CreateISO8601DateTimeFromSystemDateTime to create relevant DateTime string. DateTime firstDay = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1); string firstDayValue = SPUtility.CreateISO8601DateTimeFromSystemDateTime(firstDay); string firstDayValueplus1Month = SPUtility.CreateISO8601DateTimeFromSystemDateTime(firstDay.AddMonths(1)); ...


0

Here are the steps you should follow Since CAML don't have distinct option, you need to get all documents and then create an Array of distinct Parent Id Then for each Parent Id, get all documents which has NULL process number Now loop through those documents updating the process number


0

In a situation like this I would go for a C# console application using CSOM. The advantage of using CSOM is that you can run the same code from the same machine and update any environment by changing the site url. Here is an example on how to use CSOM with SharePoint 2010: https://msdn.microsoft.com/en-us/library/ff798388.aspx Here is a SharePoint 2013 ...



Top 50 recent answers are included