FieldCollection.GetByInternalNameOrTitle method

Returns the first field object with the specified internal name or title from the collection.

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

Syntax

'Declaration
Public Function GetByInternalNameOrTitle ( _
    strName As String _
) As Field
'Usage
Dim instance As FieldCollection
Dim strName As String
Dim returnValue As Field

returnValue = instance.GetByInternalNameOrTitle(strName)
public Field GetByInternalNameOrTitle(
    string strName
)

Parameters

  • strName
    Type: System.String

    A string that specifies the internal name or title of the field.

Return value

Type: Microsoft.SharePoint.Client.Field
A Field object that represents the field.
It must not be a null reference (Nothing in Visual Basic). It must not be empty.

Exceptions

Exception Condition
SPException

There is a COM exception that is not a throttle failure or a join throttle failure. Error code: -1.

SPQueryThrottledException

There is a throttle failure. Error code: -2147024860.

There is a join throttle failure. Error code: -2147024749.

ArgumentException

The field with the specified internal name or title does not exist in the collection at the given scope. Error code: - 2147024809.

UnauthorizedAccessException

The current user has insufficient permissions. Error code: - 2147024891.

Remarks

The GetByInternalNameOrTitle method searches first for an internal name, and then by title if an internal name is not found.

See also

Reference

FieldCollection class

FieldCollection members

Microsoft.SharePoint.Client namespace