分享方式:


<CustomRule> (RibbonDiffXml)

適用於: CRM 2015 on-prem, CRM Online

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

語法

<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 JScript 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)

指定布林資料類型、可做為參數傳遞的值。

<CrmParameter> (RibbonDiffXml)

代表從 Microsoft Dynamics CRM 應用程式擷取,可做為參數傳遞的資料。

<DecimalParameter> (RibbonDiffXml)

指定小數資料類型、可做為參數傳遞的值。

<IntParameter> (RibbonDiffXml)

指定整數資料類型、可做為參數傳遞的值。

<StringParameter> (RibbonDiffXml)

指定字串資料類型、可做為參數傳遞的值。

上層元素

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 2015 and Microsoft Dynamics CRM Online
Send comments about this topic to Microsoft.
© 2014 Microsoft Corporation. All rights reserved.