Today I had to get all the approved items from a list using ecmascript. The simple soltuion was a CAMl query with value of 16.
So here is the CAML -
var query = '<view><query><where><eq><fieldref Name="Approved" />
<value Type="Text">16</Value></Eq></Where></Query>
<viewfields><fieldref Name="Title" /></ViewFields></View>';
var camlQuery = new SP.CamlQuery();
camlQuery.set_viewXml(query);
var allItems = list.getItems(camlQuery);
context.load(allItems);
16 is the number for Approved status
No comments:
Post a Comment