This project is read-only.

How to use the Script Injector

Make sure you have configured everything like described in the section Configuration.

Open you Project that contains your Script-Files. It could look like this:


If you want to modify existing script you can overstep the next paragraph.

If you start with a new script you need to write a basic *.js file and register it in CRM. The script should contain the function as empty containers without any content. You also need to link the script to the form where you want to use it and map the functions to the event. Check the CRM SDK to get more information about adding scripts to a form. Make sure you have published your new file and also the Entity/Form where you have integrated it. Now you are ready to use the Script Injector and save some time you usually need for uploading and publishing the changed js-file anytime you did something.

To get ready for testing you simply need to open the Script Injector Tools Window which you can find under Tools –> CRM2011Tools –> ScriptInjector


The Tool window will pop somewhere on your Screen. Simply put it where you want to have it.
The Toolbar mainly has a Start/Stop-Button and a Drop-List to select the instance you want to “inject”. You will see, that all Buttons are grayed. You first have to select a CRM instance from the List, before you can start.
The Start Button and the Drop-List are cross-secured. You can’t change to another instance, while the Injector is running and you also can’t start, if you haven’t selected an Instance.


If you don’t see any value in the List, please read the the section about Configuration.


This small sample is working on the account-form.

I have created a sample account:


In the OnLoad event there is some script already registered. Here I grayed it out.

Simply add something easy like this:

alert(‘Hello CRM 2011 Visual Studio Tools User.’);

and save the file.


Make sure the Script Injector is running and reload your Account Form. You should see a Message Box popping up and greeting you as a CRM 2011 Visual Studio Tools User.


If it doesn’t work at this time and you have changed the setting right before, try a restart of Visual Studio to make sure the latest settings are used.

Last edited Aug 17, 2012 at 6:42 PM by LarsMueller, version 5


No comments yet.