共用方式為


<ValueRule> (RibbonDiffXml)

 

Applies To: Dynamics CRM 2013

A rule that detects the value of a specific field.

Syntax

<ValueRule 
 Default=["0" | "1" | "true" | "false"]
 Field="String" 
 InvertResult=["0" | "1" | "true" | "false"]
 Value="String" 
 />

Attributes and Elements

The following describes the attributes, child elements, and parent elements.

Attributes

Attribute

Description

Type

Usage

Default

Sets the default return value for the rule if the actual value cannot be determined.

Boolean

Optional

Field

The name of the form attribute to check.

String

Required

InvertResult

Negates the return value of the rule.

Boolean

Optional

Value

Specifies the value to be passed as a parameter.

String

Required

Child Elements

This element has no child elements.

Parent Elements

Element

Description

<DisplayRule> (RibbonDiffXml)

Specifies either the definition of a rule used to display a ribbon element or a reference to a DisplayRule from a command definition.

<EnableRule> (RibbonDiffXml)

Specifies either the definition of a rule used to enable or disable a ribbon element or a reference to an EnableRule from a command definition.

<Or> (RibbonDiffXml)

Specifies a set of rules that must be evaluated together.

Remarks

For commands defined for subgrid for forms using the updated user experience, value rules cannot be used within display rules. Use this element within an <EnableRule> (RibbonDiffXml) to hide an element.

Element Information

XPath

//RibbonDiffXml/RuleDefinitions/DisplayRules/DisplayRule/ValueRule |
//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/ValueRule |
//RibbonDiffXml/RuleDefinitions/DisplayRules/DisplayRule/OrRule/Or/ValueRule |
//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/ValueRule

Schema Name

ValueRuleType

Validation File

RibbonTypes.xsd

Can be Empty

Yes

See Also

Ribbon XML reference
Customize commands and the ribbon