<EntityRule> (RibbonDiffXml)

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

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

语法

<EntityRule 
 AppliesTo=["PrimaryEntity" | "SelectedEntity"]
 Context=["Form" | "HomePageGrid" | "SubGridStandard" |"SubGridAssociated"]
 Default=["0" | "1" | "true" | "false"]
 EntityName="String" 
 InvertResult=["0" | "1" | "true" | "false"]
/>

属性和元素

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

属性

Attribute Description Type Usage

AppliesTo

确定此规则适用于窗体中将显示的实体记录还是子网格中将显示的实体记录。

Valid values:

 

Value Description

PrimaryEntity

对于窗体或子网格功能区,该规则适用于窗体中显示的实体。此选项不适用于网格功能区。

SelectedEntity

对于网格或子网格功能区,此规则适用于网格中显示的实体。

Enumeration

Optional

Context

Specifies the context of the ribbon.

Valid values:

 

Value Description

Form

For the form ribbon.

HomePageGrid

For the ribbon that is displayed for the list of records that appear in the main application navigation pane.

SubGridStandard

For the ribbon that is displayed for the list of records that appear in a subgrid in a form.

SubGridAssociated

For the ribbon that is displayed for the list of records that appear in the navigation area of a form.

String

Optional

Default

如果无法确定实际值,则设置规则的默认返回值。

This attribute is not valid when this element is a child of <TabDisplayRule> (RibbonDiffXml)

Boolean

Optional

EntityName

指定将应用此规则的实体。使用实体逻辑名称,例如“new_customentity”。

String

Required

InvertResult

对此规则的返回值求反。

This attribute is not valid when this element is a child of <TabDisplayRule> (RibbonDiffXml)

Boolean

Optional

子元素

此元素没有子元素。

父元素

Element Description

<TabDisplayRule> (RibbonDiffXml)

指定显示选项卡需满足的条件。

<DisplayRule> (RibbonDiffXml)

指定用于显示功能区元素的规则定义或指定对命令定义中的 DisplayRule 的引用。

<EnableRule> (RibbonDiffXml)

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

<Or> (RibbonDiffXml)

指定一组必须一起评估的规则。

备注

The InvertResult and Default attributes are not valid when this element is a child of <TabDisplayRule> (RibbonDiffXml)

元素信息

XPath

//RibbonDiffXml/RuleDefinitions/TabSelectionRules/TabSelectionRule/EntityRule |
//RibbonDiffXml/RuleDefinitions/DisplayRules/DisplayRule/EntityRule |
//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/EntityRule |
//RibbonDiffXml/RuleDefinitions/DisplayRules/DisplayRule/OrRule/Or/EntityRule |
//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/OrRule/Or/EntityRule

Schema Name

EntityRuleType

Validation File

RibbonTypes.xsd

Can be Empty

Yes

另请参阅

其他资源

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

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