How to update the People Picker column in SharePoint using Event Receiver



                   SPUser ouser = properties.Web.EnsureUser(User);
                   SPFieldUserValueCollection value = new SPFieldUserValueCollection();
                   value.Add(new SPFieldUserValue(properties.Web, ouser.ID, ouser.Name));
                   SPList olist = properties.Web.Lists["AssetMaster"];
                   SPListItem oitem = olist.Items.Add();
                   oitem["UserColumn"] = value;
                   oitem.Update();


Comments

Post a Comment

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell