latest Post

Dynamics CRM - Loading Dependent JS File on Ribbon button on Home Page.

 Haven't blogged for an awfully long time. I keep meaning too as we have worked on some really interesting things recently but I guess time is a big factor. 

Anyway, something I was trying today which took me a while to figure out was I wanted to create a custom ribbon button to show on both the account form page and account home (list page). 

Using the excellent ribbon workbench editor makes this a doddle but I came across an issue where my JS Method used for the button click was reliant on another JS web resource. This worked fine on the form page as I was able to load the dependent JS file directly onto the page. 

However,  I couldn't find a way to do this on the home (list page). I spent quite a while playing around with workbecheditor I knew we could create multiple JavaScript actions on the button to call functions from two different web resources but I didn't have a function to call. I first tried to leave this blank but got an error message. I was even thinking maybe I create an additional function which does nothing just to get the web resource to load onto the page. 

In the end, the simple solution was to enter NAN as the function name. This allowed me to load both web resources onto the page and only call the one function. 

Simple when you know-how eh!. 

Recommended Posts × +


Post a comment