Button Element (ISV.Config)
![]() |
[Applies to: Microsoft Dynamics CRM 4.0]
Find the latest SDK documentation: CRM 2015 SDK
Represents a button on a toolbar.
Element Information
| Number of occurrences | Zero or more |
| Parent elements | ToolBar |
| Child elements | Titles |
| XPath | //IsvConfig/configuration/Root/ToolBar/Button | //IsvConfig/configuration/Entities/Entity/ToolBar/Button |
Attributes
| Name | Description | Type | Required |
| AccessKey | Specifies a single character that works as a keyboard shortcut for accessing the button. When this is specified, ALT+<key> can be used to access this button. | String | No |
| AvailableOffline | Specifies whether the control is available offline.
Valid values: true = control is displayed when offline [default] |
Boolean | No |
| Client | Specifies the intended client for the control. The default is blank, which shows in both clients.
Valid values: Web |
String | No |
| Icon | Specifies the file name of the icon for the button. Must be a valid URL to a file that contains an icon. The icon should be 16x16 pixels. | String | No |
| JavaScript | Specifies a script to be executed when the button is clicked. See Remarks. | String | No |
| PassParams | Specifies whether information about the record and language context are passed to the URL. See Passing Parameters.
Valid values: 0 = do not pass parameters [default] |
Boolean | No |
| Url | Specifies the URL to be opened when the button is clicked. See Remarks. | String | No |
| ValidForCreate | Indicates whether the toolbar should be shown in the detail form window when an entity instance is being created. | Boolean | No |
| ValidForUpdate | Indicates whether the toolbar should be shown in the detail form window when an entity instance is being updated. | Boolean | No |
| WinMode | Specifies the window mode. See Remarks.
Valid values: 0 = Window [default] |
Unsigned byte | 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 button, and the page is on the same domain as the Microsoft Dynamics CRM server, you have access to the parent window by using the window.dialogArguments property.
For WinMode = 0, the window.open method is used. For more information, see the "open Method" topic in the MSDN Library at https://msdn2.microsoft.com/en-us/library/ms536651.aspx.
For WinMode = 1 (modal dialog), window.showModalDialog method is used. For more information, see the "showModalDialog Method" topic in the MSDN Library at https://msdn2.microsoft.com/en-us/library/ms536759.aspx.
For WinMode = 2 (modal dialog), the window.showModelessDialog method is used. For more information, see the "showModelessDialog Method" topic in the MSDN Library at https://msdn2.microsoft.com/en-us/library/ms536761.aspx.
If you configure a button to display both an Icon and a Title, if there is not enough room to display both the Icon and the text, the text will be hidden and only the Icon will remain visible. If it is critical that both the Title and the Icon be displayed, use a MenuItem element.
Example
The following code sample shows the use of the Button element.
<Button Icon="/_imgs/ico_18_debug.gif" Url="https://www.microsoft.com" PassParams="1" WinParams="" WinMode="0">
<Titles>
<Title LCID="1033" Text="English Button Text" />
</Titles>
<ToolTips>
<ToolTip LCID="1033" Text="English ToolTip Text" />
</ToolTips>
</Button>
See Also
Concepts
Tasks
Other Resources
.gif)