Adding Custom Menu Links

Adding Menu link to MSCRM is as easy as adding nodes to xml file. This can be done by editing ISV.config file located at path <wwwroot>/_Resources/.

MSCRM provides CustomMenu tag that can be introduced at:  

1.      The MenuBar element inside the Grid element can contain an ActionMenu element and one or more Button elements.
2.      The MenuBar element inside the Root element can contain a CustomMenus element.
3.      The MenuBar element inside the Entity element can contain a CustomMenus element.

Note: Adding menu Items to existing menu like “New” is not possible through ISV.config file as it clearly separates CustomMenu and default menu and not supported in MSCRM 3.0.

Adding Menu Links to Application Menu Bar

pic-2.JPG

pic-1.JPG

Adding Menu Links to Entities:

<Entities>
 <Entity name="account">
  <MenuBar>
   <CustomMenus>
    <Menu Title="Custom Menu">
     <MenuItem Title="Custom Application Window"
Url=http://www.microsoft.com/customwindow.aspx
ValidForUpdate="1" ValidForCreate="0" AvailableOffline="false" /> />
     </Menu>
    </CustomMenus>
   </MenuBar>
 </Entity>
</Entities>
 
Adding Action Menu Links to Grid:     


<Grid>
    <MenuBar>
     <ActionsMenu>
      <MenuItem Title="Coming Soon..."
Url="http://www.microsoft.com" WinMode="1" />
      <MenuSpacer />
     </ActionsMenu>
     <Buttons>
      <Button Title="Test" ToolTip="Info on Test"
Icon="/_imgs/ico_18_debug.gif"
Url="http://www.microsoft.com" WinParams="" WinMode="2" />
      <ToolBarSpacer />
    </MenuBar>
   </Grid>

Attribute

Availability Description
AvailableOffline Entity and grid only Defines whether the link should appear in the Outlook client if the client is offline. Valid options are True and False.
Client All Defines which client applications the link should appear in. Valid options are Web and Outlook. If you leave this blank or ignore the node, the menu item will display in both client applications.
JavaScript All If populated, Microsoft CRM will execute the JavaScript. If populated, the Url attribute will be ignored.
PassParams Entity and grid only If set to 1, Microsoft CRM will pass the entityid and enititytypecode of the entity form to the new window. Valid options are 0 (don’t pass parameters) and 1 (pass parameters).
Title All Displays the label that appears to the user.
Url All Microsoft CRM will open a window to the path specified in this attribute. If the JavaScript attribute is populated, the Url attribute will be ignored.
ValidForCreate Entity and grid only Displays menu item when the entity form is in create mode. Valid options are 0 (don’t display) and 1 (display).
ValidForUpdate Entity and grid only Displays menu item when the entity form is in update mode. Valid options are 0 (don’t display) and 1 (display).
WinMode All Determines the type of window to open. Valid options are:·         0 (normal window)·         1 (modal dialog box)·         2 (modeless dialog box)

 

3 Responses

  1. Where exactly is the *.xml menu file for an instance of CRM in the Enterprise edition?

  2. Is it possible to change existing menu text. Change “Close Opportunity” to “Complete Opportunity”?

  3. Hi ayaz,

    when i tried this in a system entity like quote it works but whenI am trying the same in a custom entity it is not working and giving me an error “Could not complete the operation due to error 80020101″ is custom menu is not supported in custom entities or I am doing something wrong ?

Leave a Reply