TroubleShoot:分配对象查询的问题

一、问题:

在使用SPQuery的时候,CAML查询分配对象是当前帐号的时候,查不出来与自己相关的。

相关CAML如下:

string caml = "<Where><Eq>";
caml += "<FieldRef Name='AssignedTo' LookupId='True'/>";
caml += "<Value Type='User'>" + SPContext.Current.Web.CurrentUser.ID + "</Value>";
caml += "</Eq></Where>";
caml += "<OrderBy><FieldRef Name='Created' Ascending='False'/></OrderBy>";

发现SPContext.Current.Web.CurrentUser.ID和分配对象的ID不一样,所以找不到。

使用这个<UserID Type='Integer'/>就可以了
 

posted on 2012-01-09 16:55  欣静赏悦  阅读(166)  评论(0编辑  收藏  举报