SP.FieldCollection.getByInternalNameOrTitle(strName) Method
Applies to: SharePoint Foundation 2010
In this article
Return Value
Applies To
Remarks
Returns the first field object with the specified internal name or title from the collection.
var value = SP.FieldCollection.getByInternalNameOrTitle(strName);
Parameters
- strName
A string that specifies the internal name or title of the field.
Type: String
Return Value
Type: SP.Field
Applies To
Exceptions
- 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.
- SPQueryThrottledException
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.