Share via


FieldCollection.Add method

Adds a field to the field collection.

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

Syntax

'Declaration
Public Function Add ( _
    field As Field _
) As Field
'Usage
Dim instance As FieldCollection
Dim field As Field
Dim returnValue As Field

returnValue = instance.Add(field)
public Field Add(
    Field field
)

Parameters

Return value

Type: Microsoft.SharePoint.Client.Field
Returns a Field instance representing the addition of a field to the field collection.

Exceptions

Exception Condition
[Microsoft.SharePoint.SPException]

It is not a valid file name or is it not a server-relative URL or it is not an absolute URL. Error code: -2146232832.

[Microsoft.SharePoint.SPException]

Field does not exist. Error code: -2130575340.

[Microsoft.SharePoint.SPException]

Formula is empty for the calculated field type. Error code: -2130575199.

[Microsoft.SharePoint.SPQueryThrottledException]

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

[Microsoft.SharePoint.SPQueryThrottledException]

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

[System.ArgumentException]

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

[System.UnauthorizedAccessException]

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

See also

Reference

FieldCollection class

FieldCollection members

Microsoft.SharePoint.Client namespace