0
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<Where><Eq><FieldRef Name="IsActive"/><Value Type="Integer">1</Value></Eq></Where><OrderBy><FieldRef Name="SortOrder"/></OrderBy>');
this.collListItem = oList.getItems(camlQuery);

clientContext.load(collListItem);

IsActive is a yes/No where I want it to return only the Yes valuesand I want it ordered by sortOrder in ascending order

2
  • What error are you getting?
    – wjervis
    Jun 27 '14 at 14:42
  • I'm not getting an error its just returning every single item in the array
    – bimbob
    Jun 27 '14 at 14:48
1

Try wrap in "<View><Query> ... </Query></View>"

var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml('<View><Query><Where><Eq><FieldRef Name="IsActive"/><Value Type="Integer">1</Value></Eq></Where><OrderBy><FieldRef Name="SortOrder"/></OrderBy></Query></View>');
this.collListItem = oList.getItems(camlQuery);

clientContext.load(collListItem);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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