Share via


<CustomRule> (RibbonDiffXml)

 

Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online

Specifies a rule used with an EnableRule definition that is composed of a reference to a function within a JavaScript library.

Syntax

<CustomRule
 Default=["0" | "1" | "true" | "false"]
 FunctionName="String"
 InvertResult=["0" | "1" | "true" | "false"]
 Library="String" >
 <BoolParameter />
 <CrmParameter />
 <DecimalParameter />
 <StringParameter />
</CustomRule>

Attributes and Elements

The following table lists 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

FunctionName

The name of a JavaScript function located in the library designated by the Library attribute.

FunctionName must follow this naming convention:

  • The first character must be a letter, an underscore ("_") character, or a dollar ("$") symbol.

  • The remaining characters may be any combination of letters, underscore characters, dollar symbols, numbers or periods.

String

Required

InvertResult

Negates the return value of the rule.

Boolean

Optional

Library

The path to a .js file containing the function named in the FunctionName attribute.

String

Required

Child Elements

Element

Description

<BoolParameter> (RibbonDiffXml)

Specifies a value with a Boolean data type that may be passed as a parameter.

<CrmParameter> (RibbonDiffXml)

Represents data retrieved from the Microsoft Dynamics 365 application that may be passed as a parameter.

<DecimalParameter> (RibbonDiffXml)

Specifies a value with a decimal data type that may be passed as a parameter.

<IntParameter> (RibbonDiffXml)

Specifies a value with an integer data type that may be passed as a parameter.

<StringParameter> (RibbonDiffXml)

Specifies a value with a string data type that may be passed as a parameter.

Parent Elements

Element

Description

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

Element Information

XPath

//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/CustomRule |
//RibbonDiffXml/RuleDefinitions/EnableRules/EnableRule/OrRule/Or/CustomRule

Schema Name

CustomRuleType

Validation File

RibbonTypes.xsd

Can be Empty

Yes

See Also

Ribbon XML reference
Customize commands and the ribbon

Microsoft Dynamics 365

© 2016 Microsoft. All rights reserved. Copyright