Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

SPFieldCollection.CreateNewField method

Creates a field based on the specified type name and display name.

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

public SPField CreateNewField(
	string typeName,
	string displayName
)

Parameters

typeName
Type: System.String

A string that contains the internal name of the type of the field.

displayName
Type: System.String

A string that contains the display name.

Return value

Type: Microsoft.SharePoint.SPField
An SPField object that represents the new field.

typeName identifies the type of the new field. It must use the internal name of the field type. Internal names must not contain spaces or punctuation marks. Examples are "Author", "BusinessData", and "SocialSecurityNumber".

Show:
© 2015 Microsoft