I am writing code for client side object model, and I want to retrieve items with specific title, like this:
var context = SP.ClientContext.get_current(); var web = context.get_web(); var lists = web.get_lists(); var productList = web.get_lists().getByTitle("Products"); var query = new SP.CamlQuery(); query.set_viewXml = "<View><Query>" + "<Where><Eq>" + "<FieldRef Name='Title' />" + "<Value Type='Text'>Acer</Value>" + "</Eq></Where>" + "</Query></View>" ; var items = productList.getItems(query); context.load(items, 'Include(Title)'); context.load(lists, 'Include(Title, Fields.Include(Title))'); context.load(web, "Title"); context.executeQueryAsync(success, fail); It's retrieving everything, and the set_viewXml is ignored. Any help?