Share via


<JavaScriptFunction> (RibbonDiffXml)

 

Applies To: Dynamics CRM 2013

Specifies an action that calls a function from a specific JavaScript library.

Syntax

<JavaScriptFunction 
 FunctionName="String"
 Library="String" >
 <BoolParameter/>
 <CrmParameter />
 <DecimalParameter/>
 <IntParameter/>
 <StringParameter/>
</JavaScriptFunction>

Attributes and Elements

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

Attributes

Attribute

Description

Type

Usage

FunctionName

The name of the JScript function to call. This string must begin with a letter, the underscore (“_”) character, or the dollar (“$”) symbol. The remaining characters can be any combination of letters, numbers, the underscore character, the dollar symbol or periods.

String

Required

Library

The name of the JScript library Web resource that contains the function. Use the $webresource: directive when specifying the library.

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

<Actions> (RibbonDiffXml)

Specifies the actions that a command will perform.

Remarks

If you are using this element to call a function that will use window.open to open a web resource, consider using the <Url> (RibbonDiffXml) action instead. With the <Url> action you can specify the Web resource using the $webresource directive to specify the web resource to open. This will allow the application to specify the URL to the cached web resource and will result in better performance, particularly if the web resource is an HTML web resource that hosts a Silverlight web resource.

Note

Opening entity forms in a dialog window using showModalDialog or showModelessDialog is not supported.

Element Information

XPath

//RibbonDiffXml/CommandDefinitions/CommandDefinition/Actions/JavaScriptFunction

Schema Name

JavaScriptFunctionType

Validation File

RibbonTypes.xsd

Can be Empty

Yes

See Also

Ribbon XML reference
Use JavaScript with Microsoft Dynamics CRM 2013
Customize commands and the ribbon