使用"FilterField1"过滤SharePoint 2013文档库. & "FilterValue1"方法,将无法过滤在文件夹和子文件夹中找到的文档 [英] Filtering a SharePoint 2013 document library using "FilterField1" & "FilterValue1" appraoch.,will not be able to filter documents that are found inside folder and sub-folders

查看:62
本文介绍了使用"FilterField1"过滤SharePoint 2013文档库. & "FilterValue1"方法,将无法过滤在文件夹和子文件夹中找到的文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理本地共享点企业服务器2013,并且遇到以下情况:-

I am working on an on-premises sharepoint enterprise server 2013, and i have the following case:-

1.内置文档库,带有内置列表视图,可以使用以下URL进行访问:-

1. a built-in document library, with the built-in list view which can be accessed using this url :-

http://servername/sitename/listname/Forms/AllItems.aspx

2.现在,我正在为文档库列表视图构建一个高级搜索部分,并且我希望通过应用如下过滤参数来受益于对文档库列表视图进行过滤的能力:-

2. now i am building an advance search section for the document library list view, and i want to benefit from the ability to filter my document library list view by applying the filtering parameters as follow:-

http://servername/sitename/listname/Forms/AllItems.aspx?FilterField1=name&FilterValue1=value&FilterField2=name2&FilterValue2=value2...

但是我对使用上述方法过滤列表视图进行了一些测试,并且我注意到当我应用以下过滤器来仅获取类型为"General"的文档时,会使用以下方法进行过滤. &他们的关键字=历史",如下:-

but i did a couple of tests on using the above approach to filter my list view, and i have noted that when i apply the following filter to get only the document which have their type="General" & their keywords="history", as follow:-

http://servername/sitename/listname/Forms/AllItems.aspx?FilterField1=documenttype&FilterValue1=general&FilterField2=keywords&FilterValue2=history

我只会获得直接添加到文档库中的文档.但是当我键入上面的url时,不会显示已添加到文件夹中的任何文档(当然,即使该文档具有其type = general并且其keyword = history)? 那么任何人都可以这样做吗?

i will only get the documents which are added directly to the document library. but any document which have been added inside a folder will not be shown when i type the above url (of course even if the document have its type=general and its keywords=history)? so can anyone adivce on this?

我的问题是我是否可以修改我的URL来检索所有预期的文档,包括在文件夹和子文件夹中找到的那些文档?或这是我遵循的列表视图筛选方法的局限性,因此我只能筛选文档 直接添加到文档库中的文件?

My question is if i can i modify my url to retrieve all the intended documents, covering the ones which are found inside folders and sub-folders? or this is a limitation inside the list view filtering approach i am following, so i can only filter the documents that have been directly added to the document library ?

谢谢

推荐答案

约翰,

SharePoint列表视图URL过滤器不支持过滤子文件夹中的文档.它仅适用于当前列表视图.

SharePoint List View Url filter won't support to filter the documents in sub folder. It only works for current list view.

对于子文件夹文档,我们可以通过Caml Query进行过滤:

For sub folder documents, we can filter by Caml Query:

ClientContext clientContext =
    new ClientContext("http://Servername/");
    List sharedDocumentsList = clientContext.Web.Lists.GetByTitle("Shared Documents");
    CamlQuery camlQuery = new CamlQuery();
   camlQuery.ViewXml = @"<View Scope='Recursive'><Query><Where><Eq><FieldRef Name='FSObjType' /><Value Type='Lookup'>0</Value></Eq></Where></Query></View>"


    ClientOM.ListItemCollection listItems =
        sharedDocumentsList.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();
    foreach (var item in listItems)
    {
       // get all document here
    }

谢谢

最好的问候


这篇关于使用"FilterField1"过滤SharePoint 2013文档库. &amp; "FilterValue1"方法,将无法过滤在文件夹和子文件夹中找到的文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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