Using the SharePoint ‘Person or Group’ field in code


 string[] Groupname = PLPSurveyAttendees.CommaSeparatedAccounts.Split(',');
                                    string Users = string.Empty;
                                    foreach (string survueygroupname in Groupname)
                                    {
                                        SPGroup ogrp = oWeb.Groups[survueygroupname];                                   
                                        Users += ogrp.ID.ToString() + ";#" + ogrp.Name.ToString() + ";#"; 
                                    }
                                    if (Users.EndsWith(";#"))
                                    {
                                        Users = Users.Substring(0, Users.Length - 2);
                                    }
                                    oListItem["Survey Attendees Group"] = Users;

Comments

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