MenuItem Element (ISV.Config)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Represents an item in a menu.

Element Information

Number of occurrences Zero or more
Parent elements Menu or SubMenu
Child elements Titles
XPath //IsvConfig/configuration//Menu/MenuItem | //IsvConfig/configuration//SubMenu/MenuItem

Attributes

Name Description Type Required
AccessKey Specifies a single character that works as a keyboard shortcut for accessing the menu item. When this is specified, ALT+<key> can be used to access this menu item. String No
AvailableOffline Set this to true if the control does not depend on the user being connected to the organization's network.

Valid values:

true = control is displayed when offline [default]
false = control is not displayed when offline

Boolean No
Client Specifies the intended client for the control. The default is blank which shows in both.

Valid values:

Web
Outlook

string No
JavaScript Specifies the JavaScript code that is executed when the menu item is clicked. String No
PassParams Specifies whether information about the record and language context are passed to the URL. See Passing Parameters.

Valid values:

0 = don't pass parameters [default]
1 = pass parameters

unsignedByte No
Url Specifies the URL to be opened when the menu item is selected. string No
ValidForCreate Specifies whether the menu item should be shown in the detail form window when an entity instance is being created. Boolean No
ValidForUpdate Specifies whether the menu item should be shown in the detail form window when an entity instance is being updated. Boolean No
WinMode Specifies the window mode.

Valid values:

0 = Window [default]
1 = Modal Dialog
2 = Modeless Dialog

unsignedByte No
WinParams Specifies the parameters to be passed to the window. The format of this parameter is different depending on the value of the WinMode parameter. String No

Remarks

You should specify either the URL or the JavaScript attribute. If both are specified, the URL is ignored.

When you open a new window from a MenuItem, you have access to the parent window by using the dialog arguments.

Examples

The following code examples show the use of the MenuItem element.

<MenuItem Url="https://www.microsoft.com" >
  <Titles>
    <Title LCID="1033" Text="New Window" />
  </Titles>
</MenuItem>
<MenuItem Url="https://www.microsoft.com" WinMode="2">
  <Titles>
    <Title LCID="1033" Text=" Modeless Dialog" />
  </Titles>
</MenuItem>
<MenuItem Url="https://www.microsoft.com" WinMode="1">
  <Titles>
    <Title LCID="1033" Text=" Modal Dialog" />
  </Titles>
</MenuItem>
<MenuItem JavaScript="alert('test');">
  <Titles>
    <Title LCID="1033" Text="Custom JavaScript " />
  </Titles>
</MenuItem>
<MenuItem Url="https://www.microsoft.com" PassParams="1" >
  <Titles>
    <Title LCID="1033" Text="Test 2" />
  </Titles>
</MenuItem>

See Also

Concepts

Tasks

Other Resources

© 2010 Microsoft Corporation. All rights reserved.