views:

24

answers:

1

We need to have a web service that queries a sharepoint list using CAML, but we do not know what version of the list that we are using. Version introduced a new field we want to use in the query if it is present, but just ignore that otherwise. If I put it in the query on the old version, we get no results. How should I check if the field exists before setting up the query?

A: 

I'm pretty sure that if you make the field nullable in the ViewFields, the query will work whether the field exists or not.

<FieldRef Name='Field1' Nullable='TRUE'/>
Rob Windsor