SharePoint CAML search on Modified By
What do I use in the value to return results using the following开发者_JS百科 CAML query in MOSS2007? The query is currently not returning any results. I have tried using the Account Name and the name displayed in the list but to now avail.
<Eq><FieldRef Name='Modified_x0020_By' /><Value Type='User'>domain\someusername</Value></Eq>
First of all, I see the internal name for the "Modified By" column is actually "Editor".
This worked for me:
<Where><Eq><FieldRef Name='Editor'/><Value Type='Text'>LastName, FirstName</Value></Eq></Where>
Here is an example from a query I used on the tasks list (but should be about the same):
Query = String.Format(CultureInfo.CurrentCulture,
"<Where><Eq><FieldRef ID='{0}' /><Value Type='User'>{1}</Value></Eq></Where>",
SPBuiltInFieldId.AssignedTo,
SPContext.Current.Web.CurrentUser.Name)
I used the id of the field instead of internal name though...might help you.
OK I managed to get this working by searching on "Author" rather than "Modified_x0020_By".
精彩评论