【发布时间】:2019-07-08 14:00:15
【问题描述】:
我正在构建一个代码,其中我将一些数据插入到 SharePoint Online 中,但它无法识别自定义列区域中的“产品”项。 我想构建一个将现有网站栏(自定义栏)添加到“产品列表”(主列表)的代码。
目前唯一正确的做法是将现有的自定义列手动添加到我的自定义列表中。
List lst = web.Lists.GetByTitle("Product List");
ListItemCreationInformation itmCreationInfo = new ListItemCreationInformation();
ListItem newItem = lst.AddItem(itmCreationInfo);
newItem["Title"] = "This is a title! Yey!";
newItem["Product"] = "Ultimate Gaming PC with gaming console";
newItem.Update();
ctx.ExecuteQuery();
Console.WriteLine("All tasks completed. Press any key to close...");
Console.ReadLine();
我希望输出类似于“产品”已自动添加到我的主列表的列中。
【问题讨论】:
-
下面的代码sn-p你试过了吗?
标签: c# visual-studio sharepoint visual-studio-2017 sharepoint-online