NEWFIELD Method
Adds a field to a SharePoint list.
Syntax
<Method ID="Text">
<SetList Scope="Request">GUID</SetList>
<SetVar Name="Cmd">NEWFIELD</SetVar>
<SetVar Name="FieldXML"><Field Name="fieldname"
MaxLength="Integer" DisplayName="displayname"
Description="text" Type="Text"/></SetVar>
<SetVar Name="AddToDefaultView">[ON|OFF]</SetVar>
<SetVar Name="owshiddenversion">Integer</SetVar>
</Method>
Parameters
ID = "Text"
Scope = "Request"
Name = "Cmd"
Name = "FieldXML"
Name = "AddToDefaultView"
Name = "owshiddenversion"
Decoded
<Method ID="0,NEWFIELDSample">
<SetList Scope="Request">GUID</SetList>
<SetVar Name="Cmd">NEWFIELD</SetVar>
<SetVar Name="FieldXML"><Field Name="Sample"
MaxLength="255" DisplayName="Sample"
Description="sample description" Type="Text"/></SetVar>
<SetVar Name="AddToDefaultView">ON</SetVar>
<SetVar Name="owshiddenversion">6</SetVar>
</Method>
Return Value
Success
Returns the code attribute, which is a signed-decimal representation of an HRESULT.
Error
Returns an XML-encoded Unicode (UTF-8) text string. See Error Message Format for Windows SharePoint Services for more information.