CAML查询启用/禁用自定义功能区按钮 [英] CAML query to enable/disable custom ribbon button
问题描述
我有一个自定义列表,当用户打开列表项显示表单时,会有一个自定义功能区。如果当前用户是特定组的成员,则应启用此功能区。这是我使用的caml查询
var id = JSRequest.QueryString [" ID"];
if(contextKey ==" ApproveRequest" ;){
var condition ='< View>< Query>< Where> <和> <等式> < FieldRef Name = \" ID \"> < / FieldRef> < Value Type = \" Integer \">'+ id +
'< / Value> < /等式> < Or>< Membership Type =" SPGroup" ID =" 447">< FieldRef Name = \" Author \" />< / Membership>< Eq>< FieldRef Name = \" Author\" /> ;< Value Type =" Integer">< UserID
Type =" Integer" />< / Value>< / Eq>< / Or> < /和大于< / Where>< / Query>< / View>';
}
但上述代码是 不工作。
这里你去了
http://sampathnarsingam.blogspot.com/2012/07/enabledisable-ribbon-button-by-users.html
https://social.technet.microsoft.com/Forums/systemcenter/en-US/343ede63-aa9f-4d84-9939-d6521b91cfa3 / ribbon-button-enabled-script-for-standard-ribbon-buttons?forum = sharepointdevelopmentprevious
I have a custom list and when the user open the list item Display form there is a custom ribbon. This ribbon should be enabled if the current user is a member of a particular Group. Here is the caml query i used
var id = JSRequest.QueryString["ID"];
if (contextKey == "ApproveRequest") {
var condition = '<View><Query><Where> <And> <Eq> <FieldRef Name=\"ID\"> </FieldRef> <Value Type=\"Integer\">' + id +
' </Value> </Eq> <Or><Membership Type="SPGroup" ID="447"><FieldRef Name=\"Author\"/></Membership><Eq><FieldRef Name= \"Author\"/><Value Type="Integer"><UserID
Type="Integer"/></Value></Eq></Or> </And> </Where></Query></View>';
}
but the above Code is not working.
Here you go
http://sampathnarsingam.blogspot.com/2012/07/enabledisable-ribbon-button-by-users.html
https://social.technet.microsoft.com/Forums/systemcenter/en-US/343ede63-aa9f-4d84-9939-d6521b91cfa3/ribbon-button-enabled-script-for-standard-ribbon-buttons?forum=sharepointdevelopmentprevious
这篇关于CAML查询启用/禁用自定义功能区按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!