This topic has not yet been rated - Rate this topic

SPField.SchemaXml Property

Gets or sets the schema that defines the field.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online
[ClientCallableAttribute]
[ClientCallableConstraintAttribute(FixedId = "validstr", Type = ClientCallableConstraintType.Custom, Value = "It MUST be an XML document that conforms to the FieldDefinition type as defined in [MS-WSSCAML] document or a string that is null or empty.")]
public string SchemaXml { get; set; }

Property Value

Type: System.String
A Collaborative Application Markup Language (CAML) string that contains the schema.

Do not call the Update method when using the SchemaXml property to modify a field.

Using this property to set a read-only attribute, such as InternalName, generates an exception.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Unable to update ColName attribute value
I was unable to update ColName attribute value.
Either with or without spField.Update() is doesn't matter.

With same code, I manage to update other attributes such as Sortable and Hidden. Any hints?