我需要查询 Sharepoint 2013 文档库并检索列表中字段值等于特定值的所有文档。我为此使用 Sharepoint 2013 CSOM 客户端 (Microsoft.SharePoint.Client)。
我可以使用以下代码成功检索除文档 URL 之外的所有 ListItem 字段:
ClientContext spContext = new ClientContext(spDocLibSite);
List cjList = spContext.Web.Lists.GetByTitle(spDocLibTitle);
CamlQuery listItemQuery = CamlQuery.CreateAllItemsQuery(100);
listItemQuery.ViewXml = "ViewXml that limits ListItems returned based on a field val";
ListItemCollection docItems = cjList.GetItems(listItemQuery);
spContext.Load(docItems);
spContext.ExecuteQuery();
foreach (ListItem listItem in docItems)
{
Console.WriteLine(listItem["Title"]); // Works correctly with all fields except URL
listItem.File.Name or Title; // Does not work, get field not initialized error
}
Run Code Online (Sandbox Code Playgroud)
文件属性似乎没有有关文档的任何数据,当我尝试访问其属性时出现错误。
我没有设置这个文档库,但它似乎是标准的,每个列表项都有一个文档,以及大约十几个包含有关该文档的各种信息的字段。如果我查看库/列表的字段列表,文档/URL 甚至没有被列为字段。我能否以某种方式从我已经检索的 ListItem 类中获取文档的 URL?谢谢。
任何人都可以通过在sharepoint 2010中使用客户端对象模型(CSOM)为Getting Sharepoint选择列表项建议好的站点或示例代码来帮助我.我需要使用CSOM打印这些选定的项目.请帮帮我.谢谢,谢谢.
AttachmentCollection 对象没有任何删除方法。我该怎么做?
目前我们正在使用新式团队网站并尝试在 SharePoint Online 中的新式团队网站上添加对象
但是我们观察到我们收到拒绝访问错误
我们尝试通过从 powershell 将站点属性 denyandaddcustomizedpages 设置为 false 并且它工作正常
但是,我们无法获得可以帮助我们使用 csom 客户端对象模型 SharePoint Online c# 实现相同目标的代码
很少有文章提到尝试使用 pnp nugget 但找不到相同的代码
是否可以在 C# 中使用 Microsoft.SharePoint.Client 以编程方式获取 Sharepoint 站点的时区?我需要 Sharepoint 站点时区以将其与特定时区匹配。
我需要使用C#managed CSOM从SharePoint 2010中的文档库中获取文件大小信息.任何机构都可以提供一些提示或分享示例代码?
我按照msdn的说明通过JSOM获取WorkflowSubscriptionService.
使用SharePoint 2013 Workflow Services客户端对象模型:http: //msdn.microsoft.com/en-us/library/office/dn481315(v = office.15).aspx
var clientContext = SP.ClientContext.get_current();
var workflowServicesManager = SP.WorkflowServices.WorkflowServicesManager.newObject(clientContext, clientContext.get_web());
var workflowSubscriptionService = workflowServicesManager.getWorkflowSubscriptionService();
Run Code Online (Sandbox Code Playgroud)
这三行总是抛出错误:TypeError:Object [object Object]没有方法'get_context'消息:"Object [object Object]没有方法'get_context'"stack:(...)get stack:function(){ [native code]} set stack:function(){[native code]} proto:Error
我找不到错误.这是一个已知的错误?