Lists.CreateContentType method

Creates a list content type on the list.

Namespace:  WebSvcLists
Assembly:  STSSOAP (in STSSOAP.dll)

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/CreateContentType", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function CreateContentType ( _
    listName As String, _
    displayName As String, _
    parentType As String, _
    fields As XmlNode, _
    contentTypeProperties As XmlNode, _
    addToView As String _
) As String
'Usage
Dim instance As Lists
Dim listName As String
Dim displayName As String
Dim parentType As String
Dim fields As XmlNode
Dim contentTypeProperties As XmlNode
Dim addToView As String
Dim returnValue As String

returnValue = instance.CreateContentType(listName, _
    displayName, parentType, fields, _
    contentTypeProperties, addToView)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/CreateContentType", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string CreateContentType(
    string listName,
    string displayName,
    string parentType,
    XmlNode fields,
    XmlNode contentTypeProperties,
    string addToView
)

Parameters

  • listName
    Type: System.String

    A string containing the name of the list on which to create the content type.

  • displayName
    Type: System.String

    A string that represents the display name of the list content type.

  • parentType
    Type: System.String

    A string that contains the content type ID of the site content type on which to base the list content type.

  • fields
    Type: System.Xml.XmlNode

    A string representing the collection of columns to include on the new site content type.

  • contentTypeProperties
    Type: System.Xml.XmlNode

    A string representing the properties to specify for the content type.

  • addToView
    Type: System.String

    A string containing "true" or "false" that designates whether to add the content type to the list view.

Return value

Type: System.String

See also

Reference

Lists class

Lists members

WebSvcLists namespace

Other resources

Content Types

Content Type IDs