- Boundaries: Static limits that cannot be exceeded by design
- Thresholds: Configurable limits that can be exceeded to accommodate specific requirements
- Supported limits: Configurable limits that have been set by default to a tested value.
You have person or group field in SharePoint list and you want to programmatically get the user or person. The below code to gets SPUser from User or Group field in the list when multiple choice and Groups are not allowed in the field: //get SPUser SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users"); SPFieldUserValue userFieldValue = (SPFieldUserValue)userField.GetFieldValue(item["Users"].ToString()); SPUser user = userFieldValue.User; This part of code would help you to get SPUser when multiple choice is allowed and groups are not allowed: //Multiple choices are allowed SPFieldUser userField = (SPFieldUser)item.Fields.GetField("Users"); SPFieldUserValueCollection userFieldValueCollection = (SPFieldUserValueCollection)userField.GetFieldValue(item["Users"].ToString()); foreach (SPFieldUserValue userFieldValue in userFieldValueCollection) { Console.WriteLine(" " + userFieldValue.User.LoginName); } And when group...
First I would like to appreciate you for the valuable information sharing with us. Thanks for making informative blog. SharePoint consulting is very important in the business world.
ReplyDeleteGreat blog and usefulness information sharing. SharePoint Consulting for portal application helps in the planning and implementation and hence helps a client with the techniques required for SharePoint.
ReplyDelete