Hi.
I'm using the SP15 List Web Service to create columns in a list. My code works fine except that it creates the fields name using the display name.
So if the xml Name/StaticName = "MyField", and the DisplayName="My Field", the field gets created with
Name = "My_x0020_Field", StaticName = "MyField" and the DisplayName="My Field"
Example:
<Fields><Method ID='1'><Field ID="{b0b3407e-1c33-40ed-a37c-2430b7a5d081}" Name="ActualWork" StaticName="ActualWork" SourceID="http://schemas.microsoft.com/sharepoint/v3" DisplayName="Actual Work" Group="Core Task and Issue Columns" Type="Number" Sealed="TRUE" AllowDeletion="TRUE" ColName="float1" RowOrdinal="0" xmlns="http://schemas.microsoft.com/sharepoint/soap/" /></Method></Fields>
Creates a field like:
<Field ID="{b0b3407e-1c33-40ed-a37c-2430b7a5d081}" Name="Actual_x0020_Work" StaticName="ActualWork" SourceID="http://schemas.microsoft.com/sharepoint/v3" DisplayName="Actual Work" Group="Core Task and Issue Columns" Type="Number" Sealed="TRUE" AllowDeletion="TRUE" ColName="float1" RowOrdinal="0" />
Not a major problem EXCEPT that GetListItems returns the rows using the NAME attribute eg: ows_Actual_x0020_Work
.../_layouts/15/FldEdit.aspx?List=GUID&Field=Actual_x0020_Work
instead of
.../_layouts/15/FldEdit.aspx?List=GUID&Field=ActualWork
Sure I can build rules... but I need it for something generic that works 100% of the time.
So is there anyway to create a field using the Name as set in the Xml element?
Thanks.