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>
🙂
pretty neat trick… 🙂
Thanks dude. You saved my day with this neat and clean solution
I lost a day trying to achive this… Thanx a lot!
Thanks mate!!!
cool trick, very nice Rajeev
When I do this, I get a JavaScript error on page load. Anyone know why?
When I do this, I get a JavaScript error on page load. Anyone know why?
Microsoft Dynamics CRM Error Report Contents
1.0
Syntax error
1
/userdefined/edit.aspx?etc=10018&pagemode=iframe&preloadcache=1447693061714
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C; .NET4.0E)
en-US
en-US
en-US
1821×1024
Web
2015-11-16T11:57:42
1033
1033
1033
1033
{91BAFA3F-150E-E511-9261-005056B96207}
{4A44E95D-1F0E-E511-9261-005056B96207}
5.0.9690.4376