Tag Info

New answers tagged

0

This was state of the art some time long ago... The Items property is not cached and therefore always requests all items from the database again, but you can avoid this with the same result as your code: SPListItemCollection items = SPContext.Current.List.Items; foreach(SPListItem item in items){ ... } some explanation: ...


0

CAML Query cannot retrieve distinct rows. You can weed out duplicate values after applying the query. DataTable dt=new DataTable(); dt.Columns.Add("team"); dt.Columns.Add("created"); dt.Columns.Add("score"); StringBuilder output = new StringBuilder(); using (ClientContext ctx = new ...


0

You can use CAML Query to a certain extend. You'd have to combine it with LINQ. First you need to know all of the teamnames var teamList = SPContext.Current.Web.Lists.TryGetList("TeamList"); var teamItems = teamList.Items; // Get all the team names in the list, but only 1 of each var teamnames = teamItems.Cast<SPListItem>().Select(item => ...


0

You could set the RowLimit property of your SPQuery object. The tag is in the schema definition of a view (direct child of ) and therefore cannot be nested inside a tag.


1

Your OnSuccess must iterate the results: function onSuccess(sender, args) { var listItemEnumerator = items.getEnumerator(); while (listItemEnumerator.moveNext()) { var oListItem = listItemEnumerator.get_current(); alert('ID: ' + oListItem.get_id()); } } Also, move the OnSuccess and OnFail inside of your main function ...


0

Update for SharePoint 2013: although MSDN lists Offset as an attribute for Today element (https://msdn.microsoft.com/en-us/library/office/ms460496.aspx), when customizing the CAML on a list view in SharePoint Designer 2013 I tried the Offset attribute but it didn't work. I used the "OffsetDays" attribute (not documented in MSDN) and the query returned the ...


3

After much trying to replicate the issue, I finally did it. It seems to be a bug with CAML and it really baffled me that how can such a big bug is still unnoticed of. Though I kept trying different approaches to resolve it including the "beginswith" but that's not a proper solution. But while trying I did a double check and voila! it worked. Combining ...


4

I was able to reproduce what I believe is the same behavior. There are two entries, one is bigger than the other. Querying the big one, returns itself. Querying the smaller one, returns both, although one does not contain the other. If you fall short of solutions, this can potentially be a bug related to the complexity of the content. wouldn't be the ...



Top 50 recent answers are included