سؤال

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