hmqcnoesy
hmqcnoesy

Reputation: 4224

SharePoint list updated column names not showing up through web services

I am using the GetListItems() method in Lists.asmx on a SharePoint 2007 server. I have noticed that when a column's name is changed in SharePoint, the web service continues to send back the column's original name instead of the new name.

I understand this is generally a good thing, but what can I do to get the service to send me the updated column name when that's what I want? Other than creating a new column, copying data, and deleting the original column?

Thanks.

Upvotes: 1

Views: 1450

Answers (1)

Marek Grzenkowicz
Marek Grzenkowicz

Reputation: 17363

Because GetListItems() uses internal names that do not change once the column is created. Check the SharePoint Internal name, Static name, Display name article for more details.

Use the Lists.GetList method to retrieve list schema - it contains both Name and DisplayName:

<Fields>
  <Field ColName="tp_ID" ReadOnly="TRUE" Type="Counter" Name="ID" PrimaryKey="TRUE" DisplayName="ID" FromBaseType="TRUE" />
<Fields>

Upvotes: 1

Related Questions