In CRM, it’s widely known that you can add buttons to both system and custom forms. However, there aren’t too many examples on how to do it, and also some practical examples. To add a button to a CRM form, you simply need to edit the ISV.config.xml file and then reset IIS.
Here’s an example on how to add a button on the Account form that when clicked, will open a new internet explorer page to www.microsoft.com.
1. Go to the following directory where the ISV.config.xml is located: C:\Program Files\Microsoft CRM\CRMWeb\_Resources and back up the file.
2. Open the file using any xml/text editor (NOTE: Some text editors may cause the xml to get corrupted so be careful. Ideally an XML editor is recommended). Add an entry for a new button to the Account toolbar.
a. <Button ToolTip = “Open Window” Icon =”/<insert relative path>” Title = “Open Window” JavaScript=”window.open(‘http://www.microsoft.com’)”;/>
<ToolBarSpacer/>
3. In the above example you can see I navigated to the Account entity’s toolbar and created the entry with the following parameters:
a. ValidForCreate: 0 = button will not show up on a “Create” form. 1 = button will show up on a “Create” form.
b. ValidForUpdate: 0 = button will not show up on an “Update” form. 1 = button will show up on an “Update” form.
c. Button ToolTip: when a user performs a mouse over action on the button, a dialog box will appear with whatever text specified here.
d. Icon: relative path of the icon used for the button.
e. Title: name to appear on the button.
f. BLOCKED SCRIPT whether to attach a JavaScript code snippet or function to the click on the button. (NOTE: You can also reference a JavaScript method here that exists in another file, however, that file must be referenced at the onLoad() or onSave() methods of that form)
4. A new button should now appear on the toolbar and after clicking it, a new internet explorer page opens to www.microsoft.com
Some really neat applications I’ve seen are below:
1. Add a button on the Account/Contact form that takes the address, sends in the parameters to MapQuest or Google Maps, and pops a window with a map of the location.
2. Add a button on any form, that when a user clicks, will create an identical copy of that form (Clone function). This can be useful when entering data numerous times where only a few entries may be different.
3. Add a button that is a shortcut to the “Apply Rule” menu item in the Action menu.