<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/UpdateContentType", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _ Public Function UpdateContentType ( _ contentTypeId As String, _ contentTypeProperties As XmlNode, _ newFields As XmlNode, _ updateFields As XmlNode, _ deleteFields As XmlNode _ ) As XmlNode
Dim instance As Webs Dim contentTypeId As String Dim contentTypeProperties As XmlNode Dim newFields As XmlNode Dim updateFields As XmlNode Dim deleteFields As XmlNode Dim returnValue As XmlNode returnValue = instance.UpdateContentType(contentTypeId, contentTypeProperties, newFields, updateFields, deleteFields)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/UpdateContentType", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] public XmlNode UpdateContentType ( string contentTypeId, XmlNode contentTypeProperties, XmlNode newFields, XmlNode updateFields, XmlNode deleteFields )
Parameters
- contentTypeId
-
A string that represents the content type ID of the site content type to update.
- contentTypeProperties
-
A string that represents the properties to update on the site content type.
Format the properties as a ContentType Element (ContentType) element, and include the element attributes for the properties you want to update.
- newFields
-
A string that represents the collection of columns to add to the site content type.
Format the column collection as a FieldRefs Element (ContentType) element, where each FieldRef Element (ContentType) child element references a site column to add to the site content type.
- updateFields
-
A string that represents the collection of columns to update on the site.
Format the column collection as a FieldRefs Element (ContentType) element, where each FieldRef Element (ContentType) child element references a column to update on the site content type.
In each FieldRef Element (ContentType) child element, include the element attributes for the column properties you want to update.
- deleteFields
-
A string that represents the collection of columns to delete from the site content type.
Format the column collection as a FieldRefs Element (ContentType) element, where each FieldRef Element (ContentType) child element references a column to delete from the site content type.
In each FieldRef Element (ContentType) child element, include the ID attributes for the column you want to delete.
For example, below is the XmlNode for newFields:
<Fields>
<Method ID="1">
<Field Name="NewCol1" ID="{ff9908d9-30af-4e8d-8b98-1df9e50f5fc4}" Required="False" DisplayName="NewCol1" />
</Method>
<Method ID="1">
<Field Name="NewCol2" ID="{595df853-8a85-422a-8eec-f06e0fc037e8}" Required="False" DisplayName="NewCol2" />
</Method>
<Method ID="1">
<Field Name="NewCol3" ID="{f4787e97-0e5f-404a-adb0-086431fa30b3}" Required="False" DisplayName="NewCol3" />
</Method>
<Fields>
For example, when the updateFields XmlDocument is passed as the updateFields parameter, it changes the display name of the Title field to 'New Title':
XmlDocument updateFields = new XmlDocument();
updateFields.LoadXml(@"<Fields>
<Method ID='0'>
<Field ID='{your field's guid here}' Name='Title' Type='Text' DisplayName='New Title' Required='TRUE' FromBaseType='TRUE' Hidden='FALSE' Customization='' />
</Method>
</Fields>");