Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SPAddFieldOptions enumeration
Collapse the table of content
Expand the table of content

SPAddFieldOptions enumeration

An enumerated list of options that can be applied when a new field is added to a list.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

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

[FlagsAttribute]
public enum SPAddFieldOptions

Member nameDescription
DefaultSet to a constant decimal value of 0. Same as AddToDefaultContentType.
AddToDefaultContentTypeSet to a constant decimal value of 1. Used to specify that a new field that is added to the list is also be added to the default content type in the site collection.
AddToNoContentTypeSet to a constant decimal value of 2. Used to specify that a new field is not be added to any content type. (If AddFieldToDefaultView or AddToAllContentTypes is set, either or both overrule this setting.)
AddToAllContentTypesSet to a constant decimal value of 4. Used to specify that a new field that is added to the specified list is also be added to all content types in the site collection.
AddFieldInternalNameHintSet to a constant decimal value of 8. Used to add an internal field name hint for the purpose of avoiding possible database locking or field renaming operations.
AddFieldToDefaultViewSet to a constant decimal value of 16. Used to specify that a new field that is added to the specified list is also be added to the default list view.
AddFieldCheckDisplayNameSet to a constant decimal value of 32. Used to confirm that no other field has the same display name.
Show:
© 2015 Microsoft