1 minute read
Matt Bramer (@iOnline247) was nice enough to reply with this suggestion:
What happens if you put a CAML query in there that says ID != 0<Query><Where><Neq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Neq></Where></Query>
I just wrote this query out by hand, so it may need some tweaking. Throw that into your call and see what happens.
Generally speaking Matt’s suggestion may not be necessary. However, if you don’t specify any CAML options at all, GetListItems uses the default view for the list. That view may or may not return what you think you’ve asked for. By specifying *something* for the options, you’re asking SharePoint to “step out of” the default view.
In SPServices itself, I generally do this by specifying:
// Override the default view rowlimit and get all appropriate rows CAMLRowLimit: 0,
The nice thing about setting the CAMLRowLimit is that you only need to pass zero as a parameter to make SharePoint stop thinking in terms of the default view. It’s simple, but effective, and doesn’t require any knowledge of CAML at all.