[英]How to filter the view in Sharepoint, basing on user selected in Infopath form?
I have a Infopath form, published to Sharepoint 2013, in which user selects exactly one person, using a people picker. 我有一个发布到Sharepoint 2013的Infopath表单,其中用户使用人员选择器选择一个人。 Outside of form I have columns DisplayName and AccountID.
在表格之外,我有DisplayName和AccountID列。 I want user, who is viewing a list, to see only objects which are either modified by him, created by him, or if he was selected in form.
我希望正在查看列表的用户只能看到由他修改,由他创建或在表单中被选中的对象。
Trying to limit the view from browser-based view creator is most probably impossible, as neither of columns available outside are of type User
. 试图限制基于浏览器的视图创建器的视图很可能是不可能的,因为外部可用的列都不属于
User
类型。 I then moved to Sharepoint Designer 2013, and dived into CAML. 然后,我移至Sharepoint Designer 2013,并涉足CAML。 This did not help either.
这也没有帮助。
How can I check, if currently logged user is the same user, as the one selected in form? 如果当前登录的用户与表单中选择的用户相同,该如何检查? I tried using CAML, but to no effect(last
FieldRef
is reference to column, in this example AccountID). 我尝试使用CAML,但没有任何效果(在此示例AccountID中,最后一个
FieldRef
是对列的引用)。
<Where>
<Or>
<Or>
<Eq>
<FieldRef Name="Editor"/>
<Value Type="Integer">
<UserID Type="Integer"/>
</Value>
</Eq>
<Eq>
<FieldRef Name="Author"/>
<Value Type="Integer">
<UserID Type="Integer"/>
</Value>
</Eq>
</Or>
<Eq>
<FieldRef Name="_638fe3aa_9161_4aa5_8bd1_862678d9fc06"/>
<Value Type="Integer">
<UserID Type="Integer"/>
</Value>
</Eq>
</Or>
</Where>
If this can be achieved from code in Infopath, or in any other way, the answer will be as well accepted - I do not want exactly CAML based answer, I want any workable answer to my problem :) 如果可以通过Infopath中的代码或以其他任何方式实现此目的,那么答案也将被接受-我不希望基于CAML的答案,我希望对我的问题有任何可行的答案:)
A simple filter in the view for each of the columns you would like to filter on set to [Me] should show logged in users only people picker values that are equal to themselves. 对于要设置为[Me]的要过滤的每个列,在视图中都有一个简单的过滤器应仅向登录用户显示与自己相等的人员选取器值。
If the field in the form is a people picker then you must be storing the user data in a column somewhere unless you are discarding the data after processing it using a rule to update other fields. 如果表单中的字段是人员选取器,那么您必须将用户数据存储在某处的列中,除非您在使用规则更新其他字段来处理数据后将其丢弃。 If that is the case, I don't see why you can't keep the people picker data stored in a column that you don't display in the view.
如果是这样,我不明白为什么您不能将人员选择器数据存储在视图中未显示的列中。 You do not have to base the filter off of a field you are actively displaying for it to work and you are already using the right type of control to get the data you need.
您不必将过滤器基于正在显示的字段即可正常工作,并且您已经在使用正确的控件类型来获取所需的数据。
Created By and Modified By columns are always user values. “创建者”和“修改者”列始终是用户值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.