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

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

Export all documents/Folders permissions to CSV using SharePoint PowerShell

SPUtility.js