0

I'm trying to query a list in an eventreceiver through properties.List.GetItems (in the itemadding event). The field I'm filtering on is a 'Person or Group' field. But the query always returns all items instead of just the ones having the user I provided.

I'm using following code:

I've already checked following post: link but this didn't resolve my problem.

the query I use is:

<Where>
        <Eq><FieldRef Name='Gebruiker' LookupId='TRUE' /><Value Type='Integer'>{0}</Value></Eq></Where>

I Also tried:

<Where><Eq><FieldRef Name='Gebruiker' LookupId='TRUE' /><Value Type='Lookup'>{0}</Value></Eq></Where>

Any help is welcome

1 Answer 1

1

I found it in the meanwhile :)

When I passed the query as a string to the GetItems function it wasn't working correctly. However when I create a SPQuery-object, pass the query (the string) to the Query property of that object and then pass that object to the GetItems function it works correctly :) .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.