Today I will give you a little trick with CAML Query: how to retrieve the current user.
Logic suggests that we write a query like this:
<Eq> <FieldRef Name='AssignedTo' /> <value Type='User'> [Me]</ Value> </ Eq>
But then, it does not work …
The proper way to retrieve the current user is to change our query like this.
<Eq><FieldRef Name='AssignedTo' /><Value Type='Integer'><UserID Type='Integer'/></Value></Eq>
And that way we get the current user.
Christopher.
As simply as this post looks, it took me hours to stumble on this solution and my problem was resolved. Thanks Chris
Hello Emmana,
Glad to read that 🙂
Thanks, Chris… If all technical posts were so short, useful and clear! :o)
Hello Ivan,
Like we said in french “Ce n’est pas la taille qui compte mais la manière de s’en servir” => “It’s not the size that matters but how you use it” 😀
Thanks you 🙂