SPFieldCollection.TryGetFieldByStaticName method

Returns the field with the specified static name from the collection.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)


Public Function TryGetFieldByStaticName ( _
    staticName As String _
) As SPField
Dim instance As SPFieldCollection
Dim staticName As String
Dim returnValue As SPField

returnValue = instance.TryGetFieldByStaticName(staticName)
public SPField TryGetFieldByStaticName(
    string staticName


  • staticName
    Type: System.String

    A string that specifies the static name of the field.

Return value

Type: Microsoft.SharePoint.SPField
An SPField object that represents the field. If a field with the specified name does not exist, the return value is a null reference (Nothing in Visual Basic). If more than one field is found, the first one is returned.

See also


SPFieldCollection class

SPFieldCollection members

Microsoft.SharePoint namespace