SPFieldCollection.TryGetFieldByStaticName method

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

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

Syntax

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

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

Parameters

  • 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

Reference

SPFieldCollection class

SPFieldCollection members

Microsoft.SharePoint namespace

StaticName