Click to Rate and Give Feedback
Community Content
In this section
Statistics Annotations (1)
Collapse All/Expand All Collapse All
This page is specific to
The 2007 product release

Other versions are also available for the following:
SPFieldUserValue Class (Microsoft.SharePoint)
Contains the value for an SPFieldUser object.

Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
Public Class SPFieldUserValue
    Inherits SPFieldLookupValue
Visual Basic (Usage)
Dim instance As SPFieldUserValue
C#
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
public class SPFieldUserValue : SPFieldLookupValue
System.Object
   Microsoft.SharePoint.SPFieldLookupValue
    Microsoft.SharePoint.SPFieldUserValue
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
usage example: easily differentiating between users and groups for a given SPFieldUserValue      ginolee ... Thomas Lee   |   Edit   |   Show History

SPFieldUserValue userValue = (assigned prior to this code section)

string userOrGroupName = null;

// userValue refers to a group
if (userValue.User == null)
userOrGroupName = userValue.LookupValue;
else // userValue refers to a user
userOrGroupName = userValue.User.LoginName;

SPWorkflowTaskProperties childTaskCreationProperties = new SPWorkflowTaskProperties ();
childTaskCreationProperties.AssignedTo = userOrGroupName;


Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker