There are two key files that we need to understand before customizing Microsoft CRM. These are:
Inetpubwwwrootweb.config
Inetpubwwwroot\_Resourcesisv.config
Both files are essentially XML files that Microsoft CRM references to determine certain application behaviors as well as to know which customizations to display.
The web.config file consists of a group of application settings that Microsoft CRM uses to determine behavior of the application. Table 14.1 lists the setting or “keys” housed in the web.config by default.
The isv.config file contains information about the installed customizations and their locations in the server's filesystem. It is in this file that you will create custom entries to tell Microsoft CRM what customizations you have created, where they should be displayed within the application, and where the supporting files exist on the CRM server.
The structure of the isv.config file is
<configuration> <Root> <MenuBar> <CustomMenus/> </MenuBar> <Areas> <Home code="home" /> <Workplace code="workplace" /> <Sales code="sfa" /> <Service code="cs" /> <Reports code="reports" /> </Areas> </Root> <Entities> <entityname> (i.e. the CRM objects; Accounts, Contacts, Leads, etc.) <MenuBar> <CustomMenus/> </MenuBar> <ToolBar/> <NavBar/> </entityname> </Entities> </configuration>
Microsoft CRM allows us to add the following components to the standard interface:
Custom Menus in the main UI areas (Home, Workplace, Sales, Service, Reports)
Custom tabs on the left navigation pain of the main UI areas
Custom menus on the individual CRM object screens (for example, Contacts, Accounts, and so on)
Custom buttons on the individual CRM object screen toolbars
Custom tabs on the individual CRM object screen left navigation panes
The following example XML illustrates the entire contents of an isv.config file with one of each of the customizations listed previously. In each case the custom menu option, toolbar button, or tab launches an external Web site. The address of the external Web site is written in the URL property. It is just as easy to have the the custom menu option, toolbar button, or tab point to a custom page under the Web server's wwwroot directory.
<configuration> <Root> <!-- The main Menu Bar located at the top of all root level areas --> <MenuBar> <!-- Custom Menu Bar Items that appear between the Goto Menu and the Help Menu --> <CustomMenus> <Menu Title="Custom Menu"> <MenuItem Title="Custom New Window" Url="http://www.msn.com"/> <MenuSpacer/> <SubMenu Title="Custom Sub Menu"> <MenuItem Title="Modeless Dialog" Url="http://www.msn.com"WinMode="2"/> <MenuSpacer/> <MenuItem Title="Modal Dialog" Url="http://investor.msn.com"
WinMode="1"/> </SubMenu> </Menu> </CustomMenus> </MenuBar> <!-- The left areas for each section in the application --> <Areas> <Home code="home"> <NavBarItem Icon="/_imgs/ico_18_debug.gif" Title="Custom Tab" Url="http:/
/www.msn.com" Id="navIsv1"/> </Home> <Workplace code="workplace"/> <Sales code="sfa"/> <Service code="cs"/> <Reports code="reports"/> </Areas> </Root> <!-- Microsoft Customer Relationship Management Entities (Objects) --> <Entities> <account> <MenuBar> <!-- Custom Menus that you may add --> <CustomMenus> <Menu Title="Custom Account Menu" ValidForCreate="0" ValidForUpdate="1"> <MenuItem Title="Coming Soon..." Url="http://www.msn.com"
PassParams="0" WinMode="1"/> <MenuSpacer/> <SubMenu Title="Custom Account Sub Menu"> <MenuItem Title="Custom Account Sub Menu" Url="http://www.msn.com" PassParams="1"/> </SubMenu> </Menu> </CustomMenus> </MenuBar> <!-- The Account Tool Bar --> <ToolBar ValidForCreate="0" ValidForUpdate="1"> <Button Title="Custom Account Button" ToolTip="Info on Test" Icon="/_imgs
/ico_18_debug.gif" Url="http://www.msn.com" PassParams="1" WinParams="" WinMode="0"/> <ToolBarSpacer/> <Button Title="Custom Account Button 2" ToolTip="Custom Button Tool Tip" Icon="/_imgs/ico_18_debug.gif" Url="http://investor.msn.com" PassParams="1" WinParams=""
WinMode="1"/> </ToolBar> <!-- The Account Left Nav Bar --> <NavBar ValidForCreate="0" ValidForUpdate="1"> <NavBarItem Icon="/_imgs/ico_18_debug.gif" Title="Account Tab" Url="http:/
/www.msn.com" Id="navItem"/> </NavBar> </account> <contact/> <lead/> <opportunity/> <incident/> <!-- Case --> <quote/> <salesorder/> <!-- Order --> <invoice/> </Entities> </configuration>
Let's take a look at the elements in the isv.config XML file, which are shown in Table 14.2:
Element | Description |
---|---|
Title | Included in several of the custom entries, this is the caption the user sees when viewing a custom menu, menu option, tab, or button |
URL | This is the location of the start page to be called by the customization. It can be any valid URL. |
WinMode | Used only with menu options because these options launch new windows. WinMode determines whether the new window will be modal or modeless. If the window is modal, the user will not be able to click or select anything in any other window until he or she closes the modal window. Dialog boxes and messages are usually modal. Modeless windows allow the user to interact with other windows while the modeless window is open.
0— Open a regular browser window with all menus, buttons, etc., accessible |
PassParams | This flag tells the CRM platform whether to pass the record's unique identifier and also the entity type (for example “1” for account, “2” for lead, “3” for opportunity, and so on) to the custom page.
0— Do not pass the record's unique identifier and entity type |
ValidForCreate | This flag tells the CRM platform whether the custom button should appear on the toolbar when creating a new record |
ValidForUpdate | This flag tells the CRM platform whether the custom button should appear on the toolbar when editing an existing record |
Id | Unique identifier for the custom menu item or button |
Icon | The URL for the icon to be displayed with this option |
WinParams | This parameter indicates how the customization window should be displayed. For example, the width and/or height of the window can be specified. For more details on this parameter, consult the Features section of the Web page found at http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/open_0.asp |
Now that we know more or less what we can do with customization, let's dive right in and go through some real-life Microsoft CRM customization examples.
Because the possibilities of Microsoft CRM customization are literally endless, we've compiled several examples to provide ideas of what can be done and how to do it.
3.15.27.30