<EnableRule> (RibbonDiffXml)

应用到: CRM 2016 on-prem, CRM Online

指定用于启用或禁用功能区元素的规则定义或指定对命令定义中的 EnableRule 的引用。

备注

The EnableRule element child elements are only valid when it is a grandchild of <RuleDefinitions> (RibbonDiffXml).

语法

<CommandDefinition>
 <EnableRules>
  <EnableRule Id="String" />
 </EnableRules>
</CommandDefinition>
<RuleDefinitions>
 <EnableRules >
  <EnableRule
   Id="String">
   <CommandClientTypeRule />
   <CrmClientTypeRule />
   <CrmOfflineAccessStateRule />
   <CrmOutlookClientTypeRule />
   <CustomRule />
   <EntityRule />
   <FormStateRule />
   <OrRule />
   <OutlookItemTrackingRule />
   <OutlookVersionRule />
   <PageRule />
   <RecordPrivilegeRule />
   <SelectionCountRule />
   <SkuRule />
   <ValueRule />
  </EnableRule>
 </EnableRules>
</RuleDefinitions>

属性和元素

The following table lists the attributes, child elements, and parent elements.

属性

Attribute Description Type Usage

Id

Either

  • A unique identifier for the definition of an Enable Rule

  • A reference to the Id value of a definition of an Enable Rule.

String

Required

子元素

Element Description

<CommandClientTypeRule> (RibbonDiffXml)

指定用于检测使用中的演示类型的规则。

<CrmClientTypeRule> (RibbonDiffXml)

指定用于检测 Microsoft Dynamics CRM 客户端的类型的规则。

<CrmOfflineAccessStateRule> (RibbonDiffXml)

指定一项规则,可用于检测带脱机访问功能的 Microsoft Dynamics CRM for Outlook 当前是否脱机运行。

<CrmOutlookClientTypeRule> (RibbonDiffXml)

指定用于检测 Microsoft Dynamics CRM for Microsoft Office Outlook 客户端的类型的规则。

<CustomRule> (RibbonDiffXml)

指定用于包含对 JavaScript 库中的函数的引用的 EnableRule 定义的规则。

<EntityRule> (RibbonDiffXml)

指定一项可检测特定实体是否位于上下文中的规则。

<FormStateRule> (RibbonDiffXml)

指定可检测窗体状态的规则。

<OrRule> (RibbonDiffXml)

一项包含规则集合的规则,如果该规则集合中的任一规则的评估结果为 true 时,则此规则的评估结果为 true。

<OutlookItemTrackingRule> (RibbonDiffXml)

一项检测是否已为 Microsoft Dynamics CRM 中跟踪的项启用此项以便启用功能区元素的规则。

<OutlookVersionRule> (RibbonDiffXml)

一项规则,用于检测 Microsoft Office Outlook 客户端的版本。

<PageRule> (RibbonDiffXml)

一项用于评估当前页的地址的规则。

<RecordPrivilegeRule> (RibbonDiffXml)

一项规则,用于检测用户对特定记录具有的权限以便启用功能区元素。

<SelectionCountRule> (RibbonDiffXml)

一项用于检测网格中选定项的数目的规则。

<SkuRule> (RibbonDiffXml)

用于检测 Microsoft Dynamics CRM 版本的规则。

<ValueRule> (RibbonDiffXml)

一项用于检测特定字段的值的规则。

父元素

Element Description

<EnableRules> (RibbonDiffXml)

包含一个启用规则的集合。

备注

The <EnableRules> (RibbonDiffXml) element is used as a child of <RuleDefinitions> (RibbonDiffXml) and <CommandDefinition> (RibbonDiffXml). When the EnableRule element is a grandchild of RuleDefinitions it defines a rule and supports a variety of child rule elements. When EnableRule is a grandchild of CommandDefinition, it simply references the EnableRule definition using the Id attribute.

元素信息

XPath

//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule |
//RibbonDiffXml/CommandDefinitions/CommandDefinition/EnableRules/EnableRule

Schema Name

  • ReferenceEnableRulesType/EnableRule

  • EnableRulesType/EnableRule

Validation File

RibbonTypes.xsd

Can be Empty

When a grandchild of <CommandDefinition> (RibbonDiffXml).

另请参阅

其他资源

Ribbon XML reference
自定义命令和功能区

Microsoft Dynamics CRM 2016 and Microsoft Dynamics CRM Online
Send comments about this topic to Microsoft.
© 2015 Microsoft. All rights reserved.