如何使用自定义列表(不是库)中的REST / JSOM / Flow在文件夹中创建文件夹和文件夹? [英] How to create a folder and a folder inside a folder using REST/JSOM/Flow in a Custom List (Not a library)?

查看:79
本文介绍了如何使用自定义列表(不是库)中的REST / JSOM / Flow在文件夹中创建文件夹和文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要求是:在自定义列表中创建项目时,应创建一个文件夹,其中包含 
与项目标题同名,
项目应该放在文件夹中。

推荐答案

在这里。

< a href ="https://sharepoint.stackexchange.com/questions/94820/c-csom-create-folders-in-lists-programmatically"> https://sharepoint.stackexchange.com/questions/94820/c-csom -create-folders-in-lists-programmingically

//Enable Folder creation for the list
 list.EnableFolderCreation = true;
 list.Update();
 context.ExecuteQuery();

 //To create the folder
 ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();

 itemCreateInfo.UnderlyingObjectType = FileSystemObjectType.Folder;
 itemCreateInfo.LeafName = folderName;

 ListItem newItem = list.AddItem(itemCreateInfo);
 newItem["Title"] = folderName;
 newItem.Update();
 clientContext.ExecuteQuery();


这篇关于如何使用自定义列表(不是库)中的REST / JSOM / Flow在文件夹中创建文件夹和文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆