共用方式為


<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 with Offline Access 目前是否以離線模式操作的規則。

<CrmOutlookClientTypeRule> (RibbonDiffXml)

指定可偵測 Microsoft Dynamics CRM for Microsoft Office Outlook 用戶端類型的規則。

<CustomRule> (RibbonDiffXml)

指定用於 EnableRule 定義的規則,由 JavaScript 程式庫內函數的參照所組成。

<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.