I want to retrive some fields with CAML Query - everytime when i execute query for example:
query.ViewXml = string.Format(@"
<View>
<Query>
<Where>
<Eq>
<FieldRef Name='IDCardNumber' LookupId='TRUE'/>
<Value Type='Text'>12345</Value>
</Eq>
</Where>
</Query>
</View>
< ViewFields >
< FieldRef Name = 'Title' />
</ ViewFields >)");
var items = list.GetItems(query);
clientContext.Load(items);
clientContext.ExecuteQuery();
Query returns 0 elements.
I tried to get all elements and with CamlQuery.CreateAllItemsQuery();
- and in date I see correct count in list data, but FieldValues in elements look like this:
Screenshot from VS Locals
In CAML Query Builder Tool:
<Where>
<IsNotNull>
<FieldRef Name='Title' />
</IsNotNull>
</Where>
</Query>
Returns: Screenshot from CAML Query Builder
How to get these values correctly?