New answers tagged

2

Document sets are just "fanzy" folders, so you have to use scope RecursiveAll. query.ViewXml = "<View Scope=\"RecursiveAll\" /> "; Or simply use the CreateAllItemsQuery that sets the same caml markup: CamlQuery query = CamlQuery.CreateAllItemsQuery();


1

An "and" can only have 2 child nodes, thus you should amend your CAML: myquery.Query = " <Where> <And> <Eq> <FieldRef Name='Company'/><Value Type='Text'>" + ddComFilter.SelectedItem.Text + "</Value> </Eq> </And> <And> <Gt> <FieldRef ...


4

You can not have more than 2 statements in every <And> / <Or> tag. Also you seem to be missing an <Eq> (or whatever you need) around your first <FieldRef> tag. So instead do this myquery.Query = " <Where> <And> <Eq> <FieldRef Name='Company'/><Value Type='Text'>" + ...


2

Query should be like camlQuery.ViewXml = "<View><Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>Test1</Value></Eq></Where></Query></View>";


0

Found the answer. If you want to retrieve all list items just don't put anything for the CamlQuery. private static ListItemCollection GetListItems(List docLibrary, ClientContext ctx) { CamlQuery query = new CamlQuery(); var listItems = docLibrary.GetItems(query); ctx.Load(listItems); ...


1

Try this if it works for you. You can avoid first five items using below mentioned listitems.getEnumerator() code. function getItemsToBeUpdated() //this function called on button click to get ID's { var clientContext = new SP.ClientContext.get_current(); var oList = ...


0

I would grab the first 10 items, store them in an array, then return the last 5 items from the array.


0

I am using the old soap service (Lists.asmx, GetListItems) to retrieve calender items for the current month. Used this webservice to be able to retrieve recurrences. My query is very similar to yours except that I am supplying the start date in a different way. Query: <Where> <And> <Geq><FieldRef ...


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

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

We have had great success doing 12 - 1 month queries to obtain these types of events for the year. We then cache them and check for updates periodically. You have to be careful for duplicates near the month boundary, so keep track of the unique event id when caching. Please see this linked StackOverflow question for the CAML query, explanation and ...


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

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") + ...



Top 50 recent answers are included