Archive
Loading dependent jscript libraries in ribbon button’s execution CRM 2011
Hi,
I have a ribbon button on my “Account” main grid .
I am calling function “sayHello” which is in my web resource “account_ribbon” by defining custom action like below.
<Actions>
<JavaScriptFunction Library=”$webresource:account_ribbon” FunctionName=”sayHello”>
</JavaScriptFunction>
</Actions>
Now the problem is, I need to call another method from my “sayHello” function, which is in other web resource “common”.
Solution :-
The solution is simple. We can add all the required libraries to <Actions> node like below
<JavaScriptFunction Library=”$webresource:common” FunctionName=”isNaN” />
Note – Since <JavaScriptFunction> requires a function name, pass “isNaN”.
Now my <Actions> node look like below
<Actions>
<JavaScriptFunction Library=”$webresource:account_ribbon” FunctionName=”sayHello”>
</JavaScriptFunction>
<JavaScriptFunction Library=”$webresource:common” FunctionName=”isNaN”>
</JavaScriptFunction>
</Actions>
🙂