2
votes

I have a small bit of custom functionality which I need to run from each and every grid ribbon in CRM 2011. The functionality is in a JS web-resource and I can attach it to a button enable rule and it all works fine.

The issue is that I need this to run on every grid in CRM, but I'm struggling to find something in the ribbon which appears on every screen. I did try attaching it to one of the buttons in the Jewel menu, but this only fires if the user clicks on the "File" tab.

Any thoughts...?

3
can you add a screenshot? will be easier to understand where you want to put this functionalityGuido Preite
Screenshot won't really help, it needs to be everywhere. It is a small background process to keep a user logged into an external system while they are logged into CRM.Matt

3 Answers

0
votes

The jewel menu button is a good idea.

Add an anonymous JavaScript function to the library you are adding to the jewel button. This will run when the library is loaded, just after the page loads:

var whatever = 30; // maybe you do not need a parameter
(function (what) {

    /* Do what you need to do */

}(whatever));
0
votes

If it’s on premise I‘d inject my script to the ribbon.js or global.js or some other js and ping from there.

Another option, less intrusive , is to use a resource that runs in each and every form i.e. myframewrok.js. This resource can check for the opener and inject the script to the opener dynamically.

A third options might be to ping a web service using a plug-in registered on execute or retrieve multiple messages which fire repeatedly for any grid in the system.

0
votes

In the end we attached it to the "Advanced Find" button as this appeared on every ribbon that we needed the functionality on. The Jewel menu did not seem to work for us as it only fired when the user actually clicked the "File" button.