If you try to assign,
ListItem["UserField"]=SPContext.Web.CurrentUser
And you get th Error " value does not fall in expected range"
Cause: ListItem is in different Sitecollection
So Directly You can not assign current user.
Resolution:
SPUser differntSiteCollectionUser = differentWeb.SiteUsers.GetByEmail(currentUserMailId);-->GetmailID with SPFieldUserValue
No comments:
Post a Comment