I have a CAML query which returns lists by a lookup field.
here is the query
<Query>
<Where>
<Eq>
<FieldRef Name='Ticket' LookupId = 'TRUE' />
<Value Type='Lookup'>75</Value>
</Eq>
</Where> </Query>
According to the data in my list this query should not return anything, but it returns all the rows. in a couple of articles, removing Query tag suggested as fix, but it did not fix my issue.
is there any way to find why this query does not work? I am using Client Object Model
Update: Here is the code I use to query items,
SP.ListItemCollection noteItems = null;
List<TicketNote> notes = new List<TicketNote>();
using (SP.ClientContext clientContext = GetClientContext())
{
SP.List oList = clientContext.Web.Lists.GetByTitle("Note");
SP.CamlQuery camlQuery = new SP.CamlQuery();
camlQuery.ViewXml = @"
<Query>
<Where>
<Eq>
<FieldRef Name='Ticket' LookupId = 'True' />
<Value Type='Lookup'>75</Value>
</Eq>
</Where></Query>";
noteItems = oList.GetItems(camlQuery);
clientContext.Load(noteItems);
clientContext.ExecuteQuery();
}
Thanks