Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to query all items in a meeting workspace list. I'm trying a query I think should work, but still only returns items specific to the instanceID. Is there a different flavor for client side caml?

Here's my JavaScript:

var camlQuery = new SP.CamlQuery();
var viewXML = "<View><Query><Where><IsNotNull><FieldRef Name=\'Registrant\' /></IsNotNull></Where></Query><QueryOptions><MeetingInstanceID>-1</MeetingInstanceID></QueryOptions></View>";
camlQuery.set_viewXml(viewXML);

Thanks for any insight.

share|improve this question

2 Answers 2

I don't think the <QueryOptions> element is supported in the Client Object Model.

For your requirement, if you want to get all the items in a list, you can use the follwing code:

var camlQuery = new SP.CamlQuery.CreateAllItemsQuery();

You don't need to specify the viewXml explicitly in this case.

share|improve this answer
    
Unfortunately, this doesn't seem to work with meeting workspaces. All queries are automatically filtered by InstanceID. I'm not really looking for an all items query, but just a way to defeat the instanceID filtering. It's looking like I'll have to use the Lists web service. –  Blue Murphy Mar 14 '12 at 13:04
up vote 0 down vote accepted

It turns out the QueryOptions element is not used in the CamlQuery object in the client object model. I eventually turned to SPServices. Here is the statement that did the trick for me:

$().SPServices({
  operation: "GetListItems",
  async: false,
  listName: "Registrants",
  CAMLViewFields: "<ViewFields><FieldRef Name=\'Registrant\' /></ViewFields>",
  CAMLQuery: "<Query><Where><Eq><FieldRef Name=\'Registrant\' LookupId=\'TRUE\'/><Value Type=\'Lookup\'>" + cUserId +"</Value></Eq></Where></Query>",
  CAMLQueryOptions: "<QueryOptions><MeetingInstanceID>-1</MeetingInstanceID></QueryOptions>",
  completefunc: function(xData,Status){
    regListCount=$(xData.responseXML).SPFilterNode("rs:data").attr("ItemCount");
    regInstanceId=$(xData.responseXML).SPFilterNode("z:row").attr("ows_InstanceID");
    regItemId=parseInt($(xData.responseXML).SPFilterNode("z:row").attr("ows_ID"));
  }
});
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.