SharePoint 2007 动态筛选查找
大家早上好。我正在寻求有关在 SharePoint 2007 中设置库模板的帮助。详细信息如下:
我有一个包含多个子网站的父网站。
我想设置一个库模板,然后可以将其放置在每个子网站上。这些库将从父站点上的一系列集中列表中提取内容,以提供元数据选项。这样,我只需维护一组列表,并且维护的列表信息将可供每个库使用。
由于库存在于主站点的子站点上,因此我无法使用简单的查找。常规查找列类型仅适用于当前网站内的列表。
我可以访问已筛选的查找列类型,这似乎是正确的选择,因为它允许我访问父站点上的集中列表。
我希望在将文件上传到基于此模板的库时提示用户。选择文件后,用户会看到要填写的元数据选项列表。
我想让第一个过滤查找为用户提供一个选择列表。目前这工作正常。
我希望第二个筛选查找根据第一个筛选查找中的选择提供筛选的选项列表。
有一个 CAML 查询过滤字符串部分,这就是我遇到的问题。如何编写一个字符串来引用字段而不是静态值?
这是我尝试过的。在“应用查询过滤器”字段中,我输入:
<Where>
<Eq>
<FieldRef Name='Category' /><Value Type='Lookup'>Blue</Value>
</Eq>
</Where>
这有效,但仅提供值为 Blue(静态字符串)的结果。我正在寻找一种方法来引用类别的实际选定值。其效果是:
<Where>
<Eq>
<FieldRef Name='Category' /><Value Type='Lookup'>[Category.Value]</Value>
</Eq>
</Where>
我现在的困惑是我不知道正确的语法,或者这种语法是否存在。
非常感谢您的建议。我并不局限于这种方法,所以如果有其他方法可以实现相同的目标,我会很乐意接受。
Good morning, all. I'm looking for help with setting up a library template in SharePoint 2007. Here are the details:
I have a parent site with several subsites.
I want to set up a library template that can then be placed on each subsite. These libraries are going to pull from a series of centralized lists on the parent site in order to provide metadata options. This way, I only have to maintain one set of lists and the maintained list information will be available to each library.
Because the libraries exist on subsites of the main site, I can't use simple lookups. A regular lookup column type only works for lists within the current site.
I have access to the filtered lookup column type, and it seems like the right choice because it allows me access to the centralized lists on the parent site.
I'm looking to have the user prompted when uploading files to a library based on this template. After selecting the file, the user is presented with the list of metadata choices to fill out.
I want to have the first filtered lookup provide the user with a list of choices. This currently works properly.
I want the second filtered lookup to provide a filtered list of choices based on the selection in the first filtered lookup.
There's a section for a CAML query filter string, and this is where my hangup is. How does one write a string to reference a field as opposed to a static value?
This is what I've tried. In the Apply Query Filter field, I have put:
<Where>
<Eq>
<FieldRef Name='Category' /><Value Type='Lookup'>Blue</Value>
</Eq>
</Where>
This works, but only provides results where the value is Blue, a static string. I'm looking for a way to reference the actual selected value of Category. It would be something to the effect of:
<Where>
<Eq>
<FieldRef Name='Category' /><Value Type='Lookup'>[Category.Value]</Value>
</Eq>
</Where>
My hangup right now is I don't know the proper syntax, or if such syntax even exists.
Many thanks for your suggestions. I'm not tied to this approach, so if there's another way to accomplish the same goal, I'll be happy to entertain it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个老问题,但我现在偶然发现它 - 如果用户仍然需要帮助,我想我会回答。
您可以通过两种方式执行此操作:
1. 回调
2. 查询字符串
无论哪种方式都可以正常工作,并将为您的查询提供数据。诀窍是添加一个查找参数,例如:
或者
然后您可以在 CAML 查询中的 SPDataSource select 命令中引用该变量:
{Category} 上面的变量名称是 ParameterBinding 提供的名称。
希望这有帮助。
This is an old question, but I just now stumbled upon it - In case the user still needed help, I figured I'd answer.
You can do this 2 ways:
1. Callback
2. Querystring
Either way will work fine and will provide the data to your query. The trick is to add a lookup parameter, something like:
or
You can then reference the variable in your CAML query the SPDataSource selectcommand:
The variable name above of {Category} is the name provided by the ParameterBinding.
Hope this helps.