<CustomRule> (RibbonDiffXml)

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

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

语法

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

属性和元素

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

属性

Attribute Description Type Usage

Default

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

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

对此规则的返回值求反。

Boolean

Optional

Library

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

String

Required

子元素

Element Description

<BoolParameter> (RibbonDiffXml)

指定 Boolean 数据类型的值,该值可作为参数传递。

<CrmParameter> (RibbonDiffXml)

表示是从 Microsoft Dynamics CRM 应用程序中检索的数据,该数据可作为参数传递。

<DecimalParameter> (RibbonDiffXml)

指定 Decimal 数据类型的值,该值可作为参数传递。

<IntParameter> (RibbonDiffXml)

指定 Integer 数据类型的值,该值可作为参数传递。

<StringParameter> (RibbonDiffXml)

指定 String 数据类型的值,该值可作为参数传递。

父元素

Element Description

<EnableRule> (RibbonDiffXml)

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

<Or> (RibbonDiffXml)

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

元素信息

XPath

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

Schema Name

CustomRuleType

Validation File

RibbonTypes.xsd

Can be Empty

Yes

另请参阅

其他资源

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

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