Question

I want to call Xrm.Utility.openWebResourceDialog(...) from custom JavaScript that runs when a custom button is pressed.

In order for this to work, I have to have ClientGlobalContext.js.aspx loaded. I tried adding the following action to my button's command definition:

<JavaScriptFunction FunctionName="isNaN" Library="$webresource:ClientGlobalContext.js.aspx" />

but when I go to import the solution, I get the following error

The ribbon item my_command_id is dependent on Web resource id='ClientGlobalContext.js.aspx'

Is there any way to access XRM functionality from custom button JavaScript?

Was it helpful?

Solution

Xrm.Utility.openWebResourceDialog method is not available in the current release and will be added in next release.

OTHER TIPS

In "Library" you must specify your own js web resource where function with "FunctionName" defined, like:

<JavaScriptFunction FunctionName="myFun" Library="$webresource:myJsWebResource.js"/>

In that function you can use Xrm.Utility.openWebResourceDialog(...), because XRM.Utility functions available in every application page that supports scripting.

Xrm.Utility Reference

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top