Tuesday, February 10, 2009

Adding Custom Menu items

MSCRM provides liberty to add your own CustomMenu to cater your customized needs.
for that purpose all you need to do is to edit the ISV.config file located at path /_Resources/.
This is an xml file so we can say what you all need to do is to customize this xml to suit your needs and you are done.

To add a custom menu MSCRM provides CustomMenu tag that can be introduced in the ISV.config at the following locations:
  1. The MenuBar element inside the Grid can contain an ActionMenu element and one or more Button elements.
  2. The MenuBar element inside the Root or entity element can contain a CustomMenus element.



Adding Action Menu Links to Grid:


<grid>
<menubar>
<actionsmenu>
<menuitem title="required link 2" url="http://www.yourdomain.com/desiredfilenew.aspx" winmode="1">
<menuspacer>
</actionsmenu>
<buttons>
<button title="Test" tooltip="custom button" url="http://www.yourdomain.com/desiredActionfile.aspx" winmode="2" icon="/_imgs/ico_18_debug.gif">

<toolbarspacer>
</buttons>
</menubar>
</grid>




Adding Menu Links to Entities:


<entities>
<entity name="account">
<menubar>
<custommenus>
<menu title="Custom Menu">
<menuitem title="my file" url="http://www.yourdomain.com/desiredfile.aspx" validforupdate="1" validforcreate="0" availableoffline="false">
</menu>
</custommenus>
</menubar>
</entity>
</entities>



Adding Menu Links to Root

<!-- The main Global Menu Bar located at the top of all root level areas -->
<MenuBar>
<!-- Custom Menus that appear between the Goto Menu and the Help Menu -->
<CustomMenus>
<Menu>
<Titles>
<Title LCID="1033" Text="ISV" />
</Titles>
<MenuItem Url="http://www.microsoft.com">
<Titles>
<Title LCID="1033" Text="New Window" />
</Titles>
</MenuItem>
<MenuSpacer />
<!-- A horizontal drop down menu spacer -->
<SubMenu>
<Titles>
<Title LCID="1033" Text="ISV Tests" />
</Titles>
<MenuItem Url="http://www.microsoft.com" WinMode="2">
<Titles>
<Title LCID="1033" Text="Modeless Dialog" />
</Titles>
</MenuItem>
<MenuSpacer />
<MenuItem Url="http://www.microsoft.com" WinMode="1">
<Titles>
<Title LCID="1033" Text="Modal Dialog" />
</Titles>
</MenuItem>
<MenuSpacer />
<MenuItem JavaScript="alert('test');">
<Titles>
<Title LCID="1033" Text="Custom JavaScript" />
</Titles>
</MenuItem>
</SubMenu>
</Menu>
</CustomMenus>
</MenuBar>

No comments: