问题描述
大家好,
我已经在SharePoint Online中成功编写了远程事件接收器。它适用于文档库,名称为 "文件与QUOT;如下面的代码所示。
I have written Remote Event Receiver successfully in SharePoint Online. It is working for the Document Library in the name of "Documents" as given below code.
using(ClientContext clientContext = TokenHelper.CreateAppEventClientContext(properties,false))
              {
                  if(clientContext!= null)
                  {
                      //获取对主机网络列表的引用,其名称为"反馈"。
                      var documentsList = clientContext.Web.Lists.GetByTitle(" Documents");
                      clientContext.Load(documentsList);
                      clientContext.ExecuteQuery();
using (ClientContext clientContext = TokenHelper.CreateAppEventClientContext(properties, false))
{
if (clientContext != null)
{
//Get reference to the host web list with name Feedback
var documentsList = clientContext.Web.Lists.GetByTitle("Documents");
clientContext.Load(documentsList);
clientContext.ExecuteQuery();
}
}
我想为所有人执行RER文档库。我不应该为特定的文档库执行。我怎样才能实现它?
I would like to execute the RER for all the document libraries. I should not want to execute for specific document library. How can i achieve it?
问候
Poomani Sankaran
Poomani Sankaran
推荐答案
此片段可能对您有所帮助
This snippet might help you
foreach (List list in clientcontext.Web.Lists)
{
try
{
if (list.BaseType.ToString() == "DocumentLibrary")
{
// here u get all document library
}
}
catch()
{}
}
这篇关于适用于网站集中的所有文档库的SharePoint Online远程事件接收器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!