如何使用 Javascript 在 MS Dynamics CRM 2011 中禁用系统功能区按钮?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10813075/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 11:07:20  来源:igfitidea点击:

How to disable a system ribbon button in MS Dynamics CRM 2011 using Javascript?

javascriptdynamics-crm-2011dynamics-crm-4

提问by Hashim

Possible Duplicate:
Disable System Ribbon in CRM 2011

可能重复:
在 CRM 2011 中禁用系统功能区

Any one please explain how to disable the system ribbon button like 'Save','Save and Close'

请任何人解释如何禁用系统功能区按钮,如“保存”、“保存并关闭”

回答by Scott Durow

The best method of disabling the Save and Save & Close is to remove the 'Update' privilege from the user - CRM will automatically disable these buttons for you.

禁用保存和保存并关闭的最佳方法是取消用户的“更新”权限 - CRM 将自动为您禁用这些按钮。

If you need to do this based on some record based condition, you can use the Ribbon Workbench for Dynamics CRM:

如果您需要根据某些基于记录的条件执行此操作,您可以使用 Dynamics CRM 的 Ribbon Workbench:

1) Create a solution including the entity that you wish to change (or add the application ribbon to make the change on all ribbons)

1) 创建一个包含您希望更改的实体的解决方案(或添加应用程序功能区以在所有功能区上进行更改)

2) Add a webresource containing any javascript functions you may need to use

2) 添加包含您可能需要使用的任何 javascript 函数的 webresource

3) Load the solution into the Ribbon Workbench

3) 将解决方案加载到 Ribbon Workbench 中

4) Change to the 'Form' ribbon

4) 更改为“表单”功能区

5) Select the 'Save' button and right click->'Customise Command'

5) 选择“保存”按钮并右键单击->“自定义命令”

6) Find the command in the 'Solution elements' and change the enable rules.

6) 在“解决方案元素”中找到命令并更改启用规则。

7) If you don't need to customise any of the core enable/display rules, you can change the 'IsCore' property to True so that it uses the base definition.

7) 如果您不需要自定义任何核心启用/显示规则,您可以将“IsCore”属性更改为 True,以便它使用基本定义。

If you need any support with this - you can use http://ribbonworkbench.uservoice.com/'Contact Us'.

如果您需要任何支持 - 您可以使用http://ribbonworkbench.uservoice.com/“联系我们”。

Scott

斯科特

回答by lazarus

This is example for hidding 'Insert template' ribbon button on Email entity. Just modify this to disable your necessary button.

这是在电子邮件实体上隐藏“插入模板”功能区按钮的示例。只需修改它以禁用您需要的按钮。

var buttonID = "email|NoRelationship|Form|Mscrm.Form.email.ApplyTemplate-Large"; // id of ribbon button
var btn = window.top.document.getElementById(buttonID);
if(btn)
{
   btn.disabled = true;
}

回答by Grigory

Try to use CRM 2011 Visual Ribbon Editor. The easiest way, I think, If you use CRM On-Premises.

尝试使用CRM 2011 可视化功能区编辑器。我认为,最简单的方法是,如果您使用本地 CRM。

If not try Ribbon Workbench for Dynamics CRM 2011

如果不尝试用于 Dynamics CRM 2011 的 Ribbon Workbench