1

In working with Microsoft CRM 2011, we have a solution that contains multiple web resources, most of them JavaScript files. Some of these I'd like to make globally available (jQuery core library among them), rather than having to reference them on every form via Form Properties > Form Libraries.

Any way to do this? I'm sure there are hacks, but I want to keep everything contained within our solution so it can be ported between environments.

CBono
  • 3,803
  • 1
  • 32
  • 40

2 Answers2

1

There is a hack that you can port with your solutions. It is unsupported, but it will currently (UR13) always load a JS file. Depending on your needs after the initial JS file is loaded you may need to hook into frame src change events etc... to load your files into the correct frame.

but see this answer (it involves adding a dummy hidden Ribbon Button to the Jewel menu)

CRM 2011: Global JavaScript and button in status bar

Community
  • 1
  • 1
Adam Mills
  • 7,719
  • 3
  • 31
  • 47
  • Adding a button in the jewel and keeping it hidden to all except sys admin is unsupported? – GxG Jan 18 '14 at 10:36
  • I'm suggesting injecting JavaScript into other frames each time they load is unsupported. – Adam Mills Jan 19 '14 at 13:02
  • Isn't this somewhere in the gray? Because the actual injection is a byproduct of the button, which you could argue that is useful. – GxG Jan 20 '14 at 13:40
  • 1
    Sure, its just my opinion. But the injection relies on structure of the html (currently using iframes). If they decide to change their internal html structure the injection will break. This is why i suggest its unsupported by MS. – Adam Mills Jan 20 '14 at 15:27
1

It's funny that you ask this because just 2 days ago I was asking my team the exact same question. Between all 6ish of us (many have a few years of CRM experience) we came to the conclusion of no, it's not possible.

I have some JScript that needs to be on > 10 entities to make sure a field is populated (if a drop down is set to a certain value). Guess who was the lucky guy picked to add it to every entity?

I think the major problem lies in the fact that there isn't any type of form inheritance in CRM 2011.

ryanjones
  • 5,383
  • 4
  • 28
  • 24
  • That's unfortunate. Even without form inheritance, it doesn't seem like it should be difficult to tell CRM to load particular resources in every page. – CBono Jun 09 '11 at 18:28