Вопрос

I am trying to update the name of a folder with the code below:

folder.Item[SPBuiltInFieldId.Title] = "New folder name";
folder.Item.SystemUpdate();

I can see that the Title field of the item associated with the folder is changed. But on the default view of the document library, under the Name column I still see the old folder name.

What is the proven way of changing a folder name in SharePoint?

Thanks.

Это было полезно?

Решение

You need to update the Name field instead of the Title field.

folder.Item[SPBuiltInFieldId.Name] = "New folder name";
folder.Item.SystemUpdate();

Другие советы

You have to update the Name property of the SPFolder object.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top