0 out of 1 rated this helpful - Rate this topic

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)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
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".

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
typeName
It would be nice if there was a description for what you actually  need to provide for typeName. Does it take a SharePoint type? a .NET type?

MS: This information will be added in the next update of the SharePoint SDK on MSDN. In the meantime, typeName refers to the internal name of the type of the new field. Internal names of field types may not include spaces or punctuation marks. Examples are "Author", "BusinessData", and "SocialSecurityNumber".